mirror of
https://github.com/jbranchaud/til
synced 2026-01-09 01:58:02 +00:00
Add Source Original vimrc When Using Neovim as a vim til
This commit is contained in:
@@ -10,7 +10,7 @@ pairing with smart people at Hashrocket.
|
|||||||
|
|
||||||
For a steady stream of TILs, [sign up for my newsletter](https://tinyletter.com/jbranchaud).
|
For a steady stream of TILs, [sign up for my newsletter](https://tinyletter.com/jbranchaud).
|
||||||
|
|
||||||
_997 TILs and counting..._
|
_998 TILs and counting..._
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
@@ -1118,6 +1118,7 @@ _997 TILs and counting..._
|
|||||||
- [Split Different](vim/split-different.md)
|
- [Split Different](vim/split-different.md)
|
||||||
- [Split The Current Window](vim/split-the-current-window.md)
|
- [Split The Current Window](vim/split-the-current-window.md)
|
||||||
- [Splitting For New Files](vim/splitting-for-new-files.md)
|
- [Splitting For New Files](vim/splitting-for-new-files.md)
|
||||||
|
- [Source Original vimrc When Using Neovim](vim/source-original-vimrc-when-using-neovim.md)
|
||||||
- [Swap Occurrences Of Two Words](vim/swap-occurrences-of-two-words.md)
|
- [Swap Occurrences Of Two Words](vim/swap-occurrences-of-two-words.md)
|
||||||
- [Swapping Split Windows](vim/swapping-split-windows.md)
|
- [Swapping Split Windows](vim/swapping-split-windows.md)
|
||||||
- [Tabs To Spaces](vim/tabs-to-spaces.md)
|
- [Tabs To Spaces](vim/tabs-to-spaces.md)
|
||||||
|
|||||||
29
vim/source-original-vimrc-when-using-neovim.md
Normal file
29
vim/source-original-vimrc-when-using-neovim.md
Normal file
@@ -0,0 +1,29 @@
|
|||||||
|
# Source Original vimrc When Using Neovim
|
||||||
|
|
||||||
|
If you install [Neovim](https://neovim.io/) and open up a new `nvim` session,
|
||||||
|
you might notice that none of your carefully crafted `~/.vimrc` configuration
|
||||||
|
is taking effect.
|
||||||
|
|
||||||
|
This is because the `~/.vimrc` file is not part of Neovim's default
|
||||||
|
`runtimepath` (see `:h runtimepath` for details on what is included).
|
||||||
|
|
||||||
|
For custom user-land configuration of your Neovim sessions, you should start
|
||||||
|
with an `init.vim` file. For Mac users, it will likely be placed in
|
||||||
|
`~/.config/nvim/`. To be sure where it belongs, you can run `:echo
|
||||||
|
stdpath('config')`.
|
||||||
|
|
||||||
|
In that file, you can add any Neovim-specific configuration. You can also take
|
||||||
|
the opportunity to source your `~/.vimrc` file so that you get all those
|
||||||
|
configurations. These lines will do the trick.
|
||||||
|
|
||||||
|
```vimrc
|
||||||
|
if filereadable(expand('~/.vimrc'))
|
||||||
|
source ~/.vimrc
|
||||||
|
endif
|
||||||
|
```
|
||||||
|
|
||||||
|
Things tend to be backward compatible, so you aren't likely to run into issues
|
||||||
|
with what's in your `~/.vimrc`. At any rate, it is a good starting point for
|
||||||
|
getting back to a familiar configuration.
|
||||||
|
|
||||||
|
See `:h nvim` for more details about how to transition.
|
||||||
Reference in New Issue
Block a user