Skip to content

Latest commit

 

History

History
101 lines (66 loc) · 4.62 KB

readme.org

File metadata and controls

101 lines (66 loc) · 4.62 KB

neo vim readme

Using vim-plug for package management. Finally broke down and started configuring vim again – mostly for the package vim-fish.

Installing vim-plug

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

packages

typescript

Got typescript set up! This was tough.

Generate ctags with :Tags, then you’ll have these commands available:

CommandBehavior
:TSDefOpens the definition file for symbol under the cursor.
:TSDefPreviewOpen the definition file for the symbol under the cursor but in a preview window
:TSRefsGathers all reference of the symbol under the cursor and displays them in a quick-fix window.
:TSDocPrints the documentation for the symbol under the cursor and displays it in a split below.
:TSStartStarts the typescript client. This is called automatically.
:TSStopStops the typescript client
:TSRestartRestarts the client. This is useful if changes to the `tsconfig.json` are made during the current nvim session.
:TSTypePrints 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.
:TSGetCodeFixGets a fix for an error under the cursor.
:TSTypeDefGoes to the file where the type for the symbol is defined.
:TSEditConfigOpens the config file for the current file.
:TSOrganizeImportsOrganizes imports for the current file.
:TSGetDiagnosticsGet any syntax or semantic errors for the current file.

ruby / rails

https://github.com/tpope/vim-rails

custom keybindings

leader key

Currently set to spacebar

bindings

** <C-J> is a remapping from <C-O>, which is now used to open files in current project

Custom BindingModeCommand
<SPC> <SPC>NOpen last file
<SPC> <Tab>N,Vfzf-maps-{n,x}
<SPC> <C-Q>N:source $MYVIMRC
<SPC> f bNfzf :Buffers
<SPC> f fN:GitFiles!
<SPC> f cN:Commands
<C-O>N:GitFiles!
<C-J> / <C-I>NJump mode**
<C-]>NFollow ctag definition
<C-T>NJump back from ctag definition

nvim

BindingBehavior
K:Man -> Nice!
g fFollow definition
\c-w \c-wSwitch window

fzf

: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

ctags

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