Skip to content

Instantly share code, notes, and snippets.

# 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>
# 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
# 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>
" languageclient
let g:LanguageClient_serverCommands = {
\ 'c': [ 'clangd' ],
\ 'cpp': [ 'clangd' ],
\ 'javascript': [ 'javascript-typescript-stdio' ],
\ 'python': [ 'pyls' ],
\ 'ruby': [ 'solargraph', 'stdio' ],
\ }
'tpope/vim-unimpaired'
" clever use of brackets
'tpope/tpope/vim-surround'
" clever mappings to change 'surroundings'
@bbtdev
bbtdev / Ubuntu 18.04 rvm rubies fix
Created July 1, 2018 13:11
rvm recipe for target 'ext/openssl/all' failed ubuntu 18.04 rvm get master
rvm get master
@bbtdev
bbtdev / gist:82783aa677bcb98320cff5d9ad3b201a
Created April 3, 2018 16:47
tmux config denisa lubuntu
# ORIGINAL
# bind-key v split-window -h
# bind-key s split-window -v
# bind-key h select-pane -L
# bind-key j select-pane -D
# bind-key k select-pane -U
# bind-key l select-pane -R
is_vim="ps -o state= -o comm= -t '#{pane_tty}' \
| grep -iqE '^[^TXZ ]+ +(\\S+\\/)?g?(view|n?vim?x?)(diff)?$'"
bind-key -n C-h if-shell "$is_vim" "send-keys C-h" "select-pane -L"
@bbtdev
bbtdev / config_functions.vim
Created April 3, 2018 16:46
vim config denisa lubuntu
" tmux
fun! DoesPaneAlreadyExists()
let panes_list = split(system('tmux list-panes -s -F "#{pane_index}"', "\n"))
let panes_count = len(panes_list)
if panes_count > 1
exec ':echo "' . panes_list[1] . '"'
call system('tmux kill-pane -t ' . panes_list[1] )
else
endif
@bbtdev
bbtdev / async
Created March 16, 2018 19:06
asyncomplete
Plug 'prabirshrestha/asyncomplete.vim'
Plug 'prabirshrestha/asyncomplete-buffer.vim'
Plug 'prabirshrestha/asyncomplete-tags.vim'
Plug 'yami-beta/asyncomplete-omni.vim'
Plug 'prabirshrestha/asyncomplete-file.vim'
Plug 'prabirshrestha/asyncomplete-necovim.vim'
call asyncomplete#register_source(asyncomplete#sources#buffer#get_source_options({
\ 'name': 'buffer',
\ 'whitelist': ['*'],
@bbtdev
bbtdev / vimrc
Created March 8, 2018 13:23
vimrc with nvimcompletemanager
set nocompatible " be iMproved, required
filetype off " required
" set the runtime path to include Vundle and initialize
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
" alternatively, pass a path where Vundle should install plugins
"call vundle#begin('~/some/path/here')
" let Vundle manage Vundle, required