Skip to content

Commit 20a6ac4

Browse files
committed
feat: modern neovim support
1 parent 51f7a30 commit 20a6ac4

File tree

9 files changed

+34
-27
lines changed

9 files changed

+34
-27
lines changed

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ Version 3! Now each plugin is included and managed in its
1111

1212
## Installation
1313

14-
1. `git clone http://github.com/mutewinter/dot_vim.git ~/.vim`.
15-
1. `cd ~/.vim`.
14+
1. `git clone http://github.com/mutewinter/dot_vim.git ~/.config/nvim`.
15+
1. `cd ~/.config/nvim`.
1616

1717
Now you have a choice. The automated script or the manual process.
1818

@@ -21,7 +21,7 @@ Now you have a choice. The automated script or the manual process.
2121
**or**
2222

2323
1. `rake vim:link` to make the `.vimrc` and `.nvimrc` symbolic links.
24-
2. Install [Vundle](https://github.com/VundleVim/Vundle.vim) with `git clone https://github.com/VundleVim/Vundle.vim.git ~/.vim/bundle/Vundle.vim`
24+
2. Install [Vundle](https://github.com/VundleVim/Vundle.vim) with `git clone https://github.com/VundleVim/Vundle.vim.git ~/.config/nvim/bundle/Vundle.vim`
2525
3. `vim +PluginInstall +qall`
2626

2727
Enjoy enhanced productivity, increased levitation, reduced watermelon-related

config.vim

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,14 @@ endif
1515
" -----------------------------
1616
" File Locations
1717
" -----------------------------
18-
set backupdir=~/.vim/.backup// " Double // causes backups to use full file path
19-
set directory=~/.vim/.tmp//
20-
set spellfile=~/.vim/spell/custom.en.utf-8.add
18+
" Double // causes backups to use full file path
19+
exec 'set backupdir=' . g:vimdir . '/.backup//'
20+
exec 'set directory=' . g:vimdir . '/.tmp//'
21+
exec 'set spellfile=' . g:vimdir . '/spell/custom.en.utf-8.add'
2122
" Persistent Undo
2223
if has('persistent_undo')
2324
set undofile
24-
set undodir=~/.vim/.undo
25+
exec 'set undodir=' . g:vimdir . '/.undo'
2526
endif
2627

2728
" ---------------

vimrc renamed to init.vim

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,23 +4,30 @@
44
" Version: 3.0 - Now each plugin is included and managed in its own file!
55
" =============================================================================
66

7+
8+
if has('nvim')
9+
let g:vimdir = "~/.config/nvim"
10+
else
11+
let g:vimdir = "~/.vim"
12+
endif
13+
714
" All of the plugins are installed with Vundle from this file.
8-
source ~/.vim/vundle.vim
15+
exec "source " . g:vimdir . "/vundle.vim"
916

1017
" Automatically detect file types. (must turn on after Vundle)
1118
filetype plugin indent on
1219

1320
" Platform (Windows, Mac, etc.) configuration.
14-
source ~/.vim/platforms.vim
21+
exec "source " . g:vimdir . "/platforms.vim"
1522
" All of the Vim configuration.
16-
source ~/.vim/config.vim
23+
exec "source " . g:vimdir . "/config.vim"
1724
" New commands
18-
source ~/.vim/commands.vim
25+
exec "source " . g:vimdir . "/commands.vim"
1926
" All hotkeys, not dependant on plugins, are mapped here.
20-
source ~/.vim/mappings.vim
27+
exec "source " . g:vimdir . "/mappings.vim"
2128
" Load plugin-specific configuration.
22-
source ~/.vim/plugins.vim
29+
exec "source " . g:vimdir . "/plugins.vim"
2330
" Small custom functions.
24-
source ~/.vim/functions.vim
31+
exec "source " . g:vimdir . "/functions.vim"
2532
" Auto commands.
26-
source ~/.vim/autocmds.vim
33+
exec "source " . g:vimdir . "/autocmds.vim"

nvimrc

Lines changed: 0 additions & 1 deletion
This file was deleted.

platforms.vim

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ elseif has('gui_macvim')
3434
set macmeta
3535
endif
3636

37-
if has('macunix') || has('mac')
37+
if !has('nvim') && (has('macunix') || has('mac'))
3838
" Fix meta key for Mac
3939
let c='a'
4040
while c <= 'z'

plugins.vim

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
" Source all the plugin files again, this time loading their configuration.
2-
for file in split(glob('~/.vim/vundle_plugins/*.vim'), '\n')
2+
for file in split(glob(g:vimdir . '/vundle_plugins/*.vim'), '\n')
33
exe 'source' file
44
endfor

scripts/setup

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ echo ''
2323

2424
info 'Installing Vundle'
2525
info '-----------------'
26-
git clone https://github.com/VundleVim/Vundle.vim.git ~/.vim/bundle/Vundle.vim
26+
git clone https://github.com/VundleVim/Vundle.vim.git ~/config/nvim/bundle/Vundle.vim
2727

2828

2929
info 'Setting up Symlinks'
@@ -37,15 +37,15 @@ fi
3737

3838
info 'Installing plugins'
3939
info '-------------------------------------------------'
40-
if test $(which mvim)
40+
if test $(which nvim)
4141
then
42-
mvim -v +PluginInstall +qall
42+
nvim -v +PluginInstall +qall
4343
else
4444
if test $(which vim)
4545
then
4646
vim +PluginInstall +qall
4747
else
48-
fail 'mvim or vim not found in path.'
48+
fail 'nvim or vim not found in path.'
4949
fi
5050
fi
5151

vundle.vim

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,19 +5,19 @@
55
set nocompatible " be iMproved
66
filetype off " required!
77

8-
set runtimepath+=~/.vim/bundle/Vundle.vim
9-
call vundle#begin()
8+
exec "set runtimepath+=" . g:vimdir . "/bundle/Vundle.vim"
9+
call vundle#begin(g:vimdir . '/bundle')
1010

1111
" let Vundle manage Vundle, required
1212
Plugin 'VundleVim/Vundle.vim'
1313

1414
" Source all the plugins with a global variable set that ensures only the
1515
" Plugin 'name' code will be called.
1616
let g:vundle_installing_plugins = 1
17-
for file in split(glob('$HOME/.vim/vundle_plugins/*.vim'), '\n')
17+
for file in split(glob(g:vimdir . '/vundle_plugins/*.vim'), '\n')
1818
exe 'source' fnameescape(file)
1919
endfor
20-
for file in split(glob('$HOME/.vim/vundle_plugins/custom/*.vim'), '\n')
20+
for file in split(glob(g:vimdir . '/vundle_plugins/custom/*.vim'), '\n')
2121
exe 'source' fnameescape(file)
2222
endfor
2323
unlet g:vundle_installing_plugins

vundle_plugins/vundle.vim

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ if exists('g:vundle_installing_plugins')
22
finish
33
endif
44

5-
command! ReloadVundle source ~/.vim/vundle.vim
5+
command! ReloadVundle exec 'source ' . g:vimdir . '/vundle.vim'
66
function PluginReloadAndRun(command)
77
:ReloadVundle
88
execute a:command

0 commit comments

Comments
 (0)