diff --git a/README.md b/README.md index 14be7ea..1cc2293 100644 --- a/README.md +++ b/README.md @@ -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). -_997 TILs and counting..._ +_998 TILs and counting..._ --- @@ -1118,6 +1118,7 @@ _997 TILs and counting..._ - [Split Different](vim/split-different.md) - [Split The Current Window](vim/split-the-current-window.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) - [Swapping Split Windows](vim/swapping-split-windows.md) - [Tabs To Spaces](vim/tabs-to-spaces.md) diff --git a/vim/source-original-vimrc-when-using-neovim.md b/vim/source-original-vimrc-when-using-neovim.md new file mode 100644 index 0000000..691bea7 --- /dev/null +++ b/vim/source-original-vimrc-when-using-neovim.md @@ -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.