""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" " => Custom Config """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" set cursorline set number set relativenumber set showcmd set nowrap set nosol set ss=1 set siso=999 let g:vim_markdown_conceal = 0 nmap :q nnoremap R :.w !bash nnoremap , :w !bash nnoremap W :set wrap! nnoremap T :vertical terminal nnoremap u :set clipboard=unnamedplus nnoremap o nnoremap ddkP nnoremap ddp nnoremap s \ : if exists("syntax_on") \ syntax off \ else \ syntax enable \ endif nnoremap tt :VimwikiTable nnoremap wg :VimwikiGoto let g:vim_markdown_folding_disabled = 1 """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" " => Redirect the output of a Vim or external command into a scratch buffer """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" " Copy from : https://gist.github.com/romainl/eae0a260ab9c135390c30cd370c20cd7 " Usage: " :Redir hi ............. show the full output of command ':hi' in a scratch window " :Redir !ls -al ........ show the full output of command ':!ls -al' in a scratch window " function! Redir(cmd) for win in range(1, winnr('$')) if getwinvar(win, 'scratch') execute win . 'windo close' endif endfor if a:cmd =~ '^!' let output = system(matchstr(a:cmd, '^!\zs.*')) else redir => output execute a:cmd redir END endif vnew let w:scratch = 1 setlocal buftype=nofile bufhidden=wipe nobuflisted noswapfile call setline(1, split(output, "\n")) endfunction command! -nargs=1 -complete=command Redir silent call Redir() nnoremap r :Redir """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" " => Make Alt key works on Gnome terminal """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" " Solution is here: https://stackoverflow.com/questions/6778961 let c='a' while c <= 'z' exec "set =\e".c exec "imap \e".c." " let c = nr2char(1+char2nr(c)) endw set timeout ttimeoutlen=50 """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" " => vim-racer """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" set hidden let g:racer_cmd = "/home/jojo/.cargo/bin/racer" let g:racer_experimental_completer = 1 au FileType rust nmap gd (rust-def) au FileType rust nmap gs (rust-def-split) au FileType rust nmap gx (rust-def-vertical) au FileType rust nmap gd (rust-doc) """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" " => vim-plug """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" " run :PlugInstall to install plugins call plug#begin('~/.vim/plugged') " Add indent line Plug 'Yggdroot/indentLine' Plug 'mileszs/ack.vim' Plug 'tpope/vim-surround' Plug 'lifepillar/pgsql.vim' Plug 'vimwiki/vimwiki' Plug 'iberianpig/tig-explorer.vim' Plug 'rust-lang/rust.vim' Plug 'racer-rust/vim-racer' " Initialize plugin system call plug#end()