Skip to content

Instantly share code, notes, and snippets.

'tpope/vim-unimpaired'
" clever use of brackets
'tpope/tpope/vim-surround'
" clever mappings to change 'surroundings'
" languageclient
let g:LanguageClient_serverCommands = {
\ 'c': [ 'clangd' ],
\ 'cpp': [ 'clangd' ],
\ 'javascript': [ 'javascript-typescript-stdio' ],
\ 'python': [ 'pyls' ],
\ 'ruby': [ 'solargraph', 'stdio' ],
\ }
# zshrc
export FZF_DEFAULT_OPTS="--history=$HOME/.fzf_history"
export FZF_DEFAULT_COMMAND='ag --hidden --ignore .git -g ""'
# vimrc
# so I can have command history (CTRL-p/n)
let g:fzf_history_dir = '--history=$HOME/.fzf_history'
" FZF Esc collides with terminal Esc remap | So I can close with Esc
autocmd FileType fzf :tnoremap <buffer> <Esc> <C-g>
# MISC
VIM-MULTIPLE-CURSORS
https://github.com/terryma/vim-multiple-cursors
# crashed a lot, unstable for me
# probably incompatible with some plugins (although I fixed compatibility with ncm2 - check doc for ncm and multiple-cursos)
# should test again without plugins
NEOMAKE
https://github.com/neomake/neomake
# elixir it does not have credo, but it can be setup
# cwd must look into it, it's not changing pwd, but how does it affect LSP?
call term_start(&shell, {'cwd': 'whatever'})
:let $VIM_DIR=expand('%:p:h')<CR>:terminal<CR>cd $VIM_DIR<CR>
iex -S mix test --trace test/services/load_discounts/service_test.exs:42
dein#recache_runtimepath()
# ALT
same with alt + the first key stroke of your command.
Alt is a meta key that sends esc with any secondary key you press. so when I am in insert,
I'll use alt + 3, b to jump back 3 words. or alt+j, j, to go down a couple lines.
No remap needed.
!!! Some terminals require configuration
iterm Edit Profiles -> Keys -> ALT send +Esc
# CTRL
- set paste automation
@bbtdev
bbtdev / deoplete option 1
Created August 17, 2018 18:56
vim-nvim-lsp-snippets-fixes
link https://github.com/autozimu/LanguageClient-neovim/issues/379
function! ExpandLspSnippet()
call UltiSnips#ExpandSnippetOrJump()
if !pumvisible() || empty(v:completed_item)
return ''
endif
" only expand Lsp if UltiSnips#ExpandSnippetOrJump not effect.
let l:value = v:completed_item['word']