22 |

23 | The Vim Configuration. Build Status 24 |

25 | 26 |

If you're trying to use this config checkout this cheat 27 | sheet.

28 | 29 |
30 | 31 |

This vimfiles support both standard vim and 32 | neovim, I'd encourage you to give neovim a try.

33 | 34 |

If you're using neovim follow this 35 | guide in order to get 36 | it properly setup. The autocompletion plugin we use needs python3 37 | support too.

38 | 39 |

If you're using regular vim make sure to install it with lua support, on ubuntu 40 | that's provided with the vim-nox package and on OSX it can be installed with 41 | Homebrew by doing brew install vim --with-lua.

42 | 43 |

44 | Table of Contents

45 | 46 |
    47 |
  1. Using This Configuration
  2. 48 |
  3. 49 | Installation 50 | 51 |
      52 |
    1. 53 | Additional Dependencies 54 | 55 |
        56 |
      1. ctags
      2. 57 |
      58 |
    2. 59 |
    60 |
  4. 61 |
  5. Updating
  6. 62 |
  7. 63 | Customizing 64 | 65 |
      66 |
    1. Changing Configuration
    2. 67 |
    3. Adding Plugins
    4. 68 |
    69 |
  8. 70 |
  9. 71 | Functionality 72 | 73 |
      74 |
    1. Defaults Overridden
    2. 75 |
    76 |
  10. 77 |
  11. Screenshots
  12. 78 |
79 | 80 |

81 | Using This Configuration

82 | 83 |

This configuration is supposed to be used directly, not forked. If you intend 84 | to keep up to date with changes made to this repo it's recommended that you 85 | just clone this repository and customize the config using the provided 86 | hooks. If you have a feature or fix to submit, feel free to fork 87 | and send a PR.

88 | 89 |
90 | 91 |

92 | Installation

93 | 94 |

As simple as:

95 | 96 |
curl vimfiles.luan.sh/install | bash
 97 | 
 98 | # To override you current config:
 99 | # curl vimfiles.luan.sh/install | FORCE=1 bash
100 | 101 |

102 | Additional Dependencies

103 | 104 |

Most of the dependencies are installed automatically, assuming you have a 105 | minimal development environment for you language. For example we download all 106 | the tools for golang and elm automatically. git is assumed to be installed 107 | and so is ag or ack, if either of those is not, some plugins may not behave 108 | as expected.

109 | 110 |

111 | ctags

112 | 113 |

ctags is used to jump to function definitions, it is not strictly necessary if 114 | you don't need that functionality, if you want to be able to jump effectively 115 | to definitions install the correct version of ctags.

116 | 117 |

OSX

118 | 119 |
brew uninstall ctags
120 | brew tap universal-ctags/universal-ctags
121 | brew install universal-ctags --HEAD
122 | 123 |

Linux

124 | 125 |

exuberant-ctags from your OS is generally enough for most things, but if you 126 | want more CSS, ruby and other goodnesses you will need to manually compile and 127 | replace your ctags installation with: https://github.com/fishman/ctags

128 | 129 |
130 | 131 |

132 | Updating

133 | 134 |

You should frequently update you copy of this config, to get latest fixes and 135 | improvements. To do so you can run:

136 | 137 |
vim-update
138 | 139 |

Assuming /usr/local/bin is on your PATH on OSX or ~/bin/ on Linux.

140 | 141 |

If that doesn't work you can always run the script directly:

142 | 143 |
~/.vim/update
144 | 145 |
146 | 147 |

148 | Customizing

149 | 150 |

We load 3 extra configuration files that are NOT part of this repo:

151 | 152 |
    153 |
  • 154 | ~/.vimrc.local.before (to open: ,vb): Configuration to be set before everything else, this 155 | runs before any plugin or any config from this repository.
  • 156 |
  • 157 | ~/.vimrc.local (to open: ,vl): Configuration to be set after everything else, this runs 158 | after all other configuration is loaded and all plugins are setup.
  • 159 |
  • 160 | ~/.vimrc.local.plugins (to open: ,vp): Extra plugins to be loaded (along with maybe 161 | optional configuration for them). Is loaded after all the default plugins are 162 | installed.
  • 163 |
164 | 165 |

A common pattern is for individuals or teams to have those 3 files checked in 166 | to a separate dotfiles repository and have 167 | them be symlinked into your $HOME directory. Symlink them before you run the 168 | install script and everything should work.

169 | 170 |

171 | Changing Configuration

172 | 173 |

You might want to change some config such as disabling autocompletion or 174 | enabling auto save, or maybe just changing your colorscheme. You can do so by 175 | editing the ~/.vimrc.local file, for example:

176 | 177 |

Changing colorscheme:

178 | 179 |
colorscheme gruvbox
180 | 181 |

Enabling auto save:

182 | 183 |
" will save automatically when leaving the buffer
184 | " 0 or 1, defaults 0
185 | let g:autosave = 1
186 | 187 |

Disabling neocomplete:

188 | 189 |
let g:neocomplete#enable_at_startup = 0   " disable neocomplete
190 | let g:neocomplcache_enable_at_startup = 0 " disable the fallback version when no LUA
191 | 192 |

Some configuration values need to be set before loading plugins, for that we 193 | have the ~/.vimrc.local.before, that get's loaded before everything else, one 194 | example usage of it is enabling fancy characters for the airline plugin:

195 | 196 |
let g:airline_powerline_fonts = 1
197 | 198 |

199 | Adding Plugins

200 | 201 |

If you have a favorite plugin you want to install but couldn't convince me to 202 | add it as a default you can still have it be installed by just putting it in 203 | the ~/.vimrc.local.plugins, like such:

204 | 205 |
" Plugin to navigate between camelCase words
206 | Plug 'bkad/CamelCaseMotion'
207 | 208 |
209 | 210 |

211 | Functionality

212 | 213 |

This config packs a considerable amount of plugins, there are descriptions for 214 | most of them here in the comments. It also strives to not override 215 | default behavior, although that's not always possible.

216 | 217 |

There's space to write some 218 | guides as to how to effectively 219 | use this config for certain languages. The main targets are golang and ruby, 220 | although this configuration should be usable with most languages.

221 | 222 |

223 | Defaults Overridden

224 | 225 |

These bindings are known to be overridden in this config. Please open an 226 | issue if you find any other.

227 | 228 |
    229 |
  • 230 | |: Default behavior is jump to column. We have it set to :NERDTreeFocus.
  • 231 |
  • 232 | ,: Default is reverse repeat a f, t, F, or T search. We have it set to <leader>.
  • 233 |
  • 234 | \: Is the default <leader>. We have it set to :NERDTreeToggle.
  • 235 |
  • 236 | <enter> or <cr>: Default behavior is to move the cursor one line down. We 237 | have it set to save if modified (basically :w when the file has a change).
  • 238 |
239 | 240 |

A lot of small defaults are overridden everywhere else, and those are just to 241 | make editing a better experience and should in no way make this vim not feel 242 | like vim. For a glance in some of the changes look at 243 | config/basic.vim.

244 | 245 |

A few overridden are worth mentioning:

246 | 247 |
set splitright
248 | 249 |

These change where new splits are open, when you for example do :vs the 250 | default behavior is to open a split on the left, it feels more natural to open 251 | one on the right instead.

252 | 253 |
set iskeyword+=$,@,-
254 | 255 |

Add extra characters that are valid parts of variables.

256 | 257 |
258 | 259 |

260 | Screenshots

261 | 262 |

Default colorscheme: hybrid

263 | 264 |

hybrid

265 | 266 |

Alternate colorscheme: monokai

267 | 268 |

monokai

269 | 270 | 275 | 276 |