Using vim-plug
for package management. Finally broke down and started configuring vim again – mostly for the package vim-fish
.
Once you clone, just run :PlugInstall
to install your dependencies, then you’re off to the races.
:PlugUpdate
updates ‘em, and :PlugDiff
shows you what changed.
:help plug-options
for help/manual
Got typescript set up! This was tough.
Generate ctags with :Tags
, then you’ll have these commands available:
Command | Behavior |
---|---|
:TSDef | Opens the definition file for symbol under the cursor. |
:TSDefPreview | Open the definition file for the symbol under the cursor but in a preview window |
:TSRefs | Gathers all reference of the symbol under the cursor and displays them in a quick-fix window. |
:TSDoc | Prints the documentation for the symbol under the cursor and displays it in a split below. |
:TSStart | Starts the typescript client. This is called automatically. |
:TSStop | Stops the typescript client |
:TSRestart | Restarts the client. This is useful if changes to the `tsconfig.json` are made during the current nvim session. |
:TSType | Prints the type signature for the symbol under the cursor. |
:TSRename [word] | Renames the symbol currently under the cursor. Pass a new name as an arg, if no arg is passed, user will be prompted. |
:TSGetCodeFix | Gets a fix for an error under the cursor. |
:TSTypeDef | Goes to the file where the type for the symbol is defined. |
:TSEditConfig | Opens the config file for the current file. |
:TSOrganizeImports | Organizes imports for the current file. |
:TSGetDiagnostics | Get any syntax or semantic errors for the current file. |
https://github.com/tpope/vim-rails
Currently set to spacebar
** <C-J> is a remapping from <C-O>, which is now used to open files in current project
Custom Binding | Mode | Command |
---|---|---|
<SPC> <SPC> | N | Open last file |
<SPC> <Tab> | N,V | fzf-maps-{n,x} |
<SPC> <C-Q> | N | :source $MYVIMRC |
<SPC> f b | N | fzf :Buffers |
<SPC> f f | N | :GitFiles! |
<SPC> f c | N | :Commands |
<C-O> | N | :GitFiles! |
<C-J> / <C-I> | N | Jump mode** |
<C-]> | N | Follow ctag definition |
<C-T> | N | Jump back from ctag definition |
Binding | Behavior |
---|---|
K | :Man -> Nice! |
g f | Follow definition |
\c-w \c-w | Switch window |
:FZF
, then:
CTRL-T, CTRL-X or CTRL-V to open selected files in the current window, in new tabs, in horizontal splits, or in vertical splits respectively.
Add to actions to create your own
Guide to setting up ctags for Rails
ctags -R --languages=ruby --exclude=.git --exclude=log . $(bundle list --paths) -f .tags-json
Note: Currently gives me an error message about the -f
flag. Also, make sure you add the tags file to your .gitignore
C-]
to jump to definition, C-t
to jump back