"BASICS-------------------------------------------------------------- set exrc ""You can get some cuntomizations if therre is a vimrc on the local eare that you are it will use it. set guicursor= ""Bi cursor for oldstyle lovers. set relativenumber ""Show the line beofre and ofetr starting from your line. set noerrorbells ""No sound effects. set tabstop=4 ""TabSize of 4. set shiftwidth=4 ""Indentation fo 4. set softtabstop=4 ""Enabeling it will remplace tabs by spaces in insert mode set noexpandtab ""Enabeling it will remplace tabs by spaces set smartindent ""will try it's best to indent for you. set nowrap ""Will continue to go right when line is too long set incsearch ""incremental searching as i am typing the words will be highligted. set number ""Self explanatory set scrolloff=8 ""Will start to scroll down wehn there is still 8 Lines before end of page. "Backup and Undo set noswapfile ""No swap file. they are anoying set nobackup ""Nobackup because we will do a undo dir set undodir=~/.vim/undodir set undofile packadd termdebug let g:termdebug_wide=1 filetype plugin indent on syntax enable :autocmd InsertEnter,InsertLeave * set cul! "-------------------------------------------------------------------- "PLUGINS------------------------------------------------------------- "plugins(included with vim) for file specific mappings Located at ~/.vim/ftplugin/ "Example for c Would be: ~/.vim/ftplugin/c_mappings.vim filetype plugin on filetype plugin indent on "Plug pkluginmanager start and end call plug#begin('~/.vim/plugged') Plug 'gruvbox-community/gruvbox' Plug 'arcticicestudio/nord-vim' Plug 'vim-utils/vim-man' Plug 'mbbill/undotree' Plug 'gyim/vim-boxdraw' Plug 'vim-airline/vim-airline' call plug#end() "-------------------------------------------------------------------- "VISUALS------------------------------------------------------------- set colorcolumn=100 highlight ColorColumn ctermbg=0 guibg=lightgrey set signcolumn=yes colorscheme gruvbox set background=dark highlight Normal guibg=blue "-------------------------------------------------------------------- "REMAPS-------------------------------------------------------------- "(VIM) Remaps Space bar as the Leader command let mapleader=" " "(NAVIGATION) "Switches to the Left window map h :wincmd h "Switches to the Bottom window map j :wincmd j "Switches to the Top window map k :wincmd k "Switches to the Right window map l :wincmd l "(FILES) map pv :Ex :vertical resize 30 map pf :Sex! :vertical resize 30 "(PUGINS) "maptree Toggle map u :UndotreeToggle "(POSITION) "[P]ut one line [U]p everything from the cursor till the end of the line map pu d$Op "[P]ut one line [D]own everything from the cursor till the end of the line map pd d$op "Put at then end of the [L]ine [U]pper from the cursor (everything from the cursor till the end of the line) map lu DkApjddkI "Put at then end of the [L]ine [D]own(er) from the cursor (everything from the cursor till the end of the line) map ld DjApkddjI "Classic Vim's Windo [U]p and [D]onw controls but keeps the cursor in the middle map zz map zz "Classic Vim's [n]ext and [N]previous controls but keeps the cursor in the middle map n nzzzv map N Nzzzv "Mooves what's under the cursor map J :m '>+1gv=gv map K :m '<-2gv=gv "(COPY PASTE) "Copy to your clipboard of your system and not in the internal buffer of vim map y [["+y]]) map Y [["+Y]]) "(WORD) Manipulation "[W]ord [R]reformat for word under the cursor map wr [[:%s/\<\>//gI]] "[C]hange [W]ord in registered buffer To be more similar to whant vim implment map cw ebvey/0Ncw "[C]hange [N]ext word in registered buffer To be more similar to what vim implements map cn ncw "[W]ord [N]ext occurence for word under the cursor map wn ebvey/0 "[W]ord [P]revious occurence for word under the cursor map wp ebvey/0NN "[W]ord [S]earch for word under the cursor map ws ebvey/0 "[W]ord [F]ind [F]irst for word under the cursor map wff ebveyG/0 "[W]ord [F]ind [L]ast for word under the cursor map wfl ebveyG/0N "-------------------------------------------------------------------- "(ADDERS) "[A]dds a [)] at the end of the line map a) A)I "[A]dds a [}] at the end of the line map a} A}I "[A]dds a ["]"] at the end of the line map a] A]I "DEBUGER-------------------------------------------------------------- map db :Termdebug :vertical resize 30 noremap ts :Step noremap to :Over noremap tn :Next noremap tc :Cont "QUICKFIX Navigation for going to the next errors and so on map ne cnextzz map me cprevzz map nl lnextzz map ml lprevzz set makeprg=bundle\ exec\ rspec\ -f\ QuickfixFormatter "-------------------------------------------------------------------- "WILDMENU FOR FUZZY FILE SEARCH-------------------------------------- set path+=** set wildmenu "Display all matching files when we tab complete " NOW WE CAN: " Type :find " - Hit tab to :find by partial match " - Use * to make it fuzzy " - Opened files will be buffered try it out " - :b lets you autocomplete any open buffer "-------------------------------------------------------------------- "TAG JUMPING--------------------------------------------------------- " Create the `tags` file (need to install ctags first) command! MakeTags !ctags -R . " NOW WE CAN: " - Use ^] to jump to tag under cursor " - Use g^] for ambiguous tags " - Use ^t to jump back up the tag stack " THINGS TO CONSIDER: " - This doesn't help if you want a visual list of tags " AUTOCOMPLETE: " The good stuff is documented in |ins-completion| " HIGHLIGHTS: " - ^x^n for JUST this file " - ^x^f for filenames (works with our path trick!) " - ^x^] for tags only " - ^n for anything specified by the 'complete' option " NOW WE CAN: " - Use ^n and ^p to go back and forth in the suggestion list "-------------------------------------------------------------------- ""(TERMINAL COMMANDS) "" Makes current file executable map mx, !chmod +x % "SNIPPETS------------------------------------------------------------ " Command Read template move cursor nnoremap shs :-1read $HOME/.vim/snippets/html_skeleton.html5jwf>a nnoremap shb :-1read $HOME/.vim/snippets/html_vertical_bracets.html:s/VARTOCHANGE//g nnoremap sht :-1read $HOME/.vim/snippets/html_horizontal_bracets.html:.,+2s/VARTOCHANGE//g nnoremap scf :-1read $HOME/.vim/snippets/c_for.cyi)/0N:s/VARTOCHANGE//g nnoremap scs :-1read $HOME/.vim/snippets/c_switch.cyi)/0Ncw nnoremap scw :-1read $HOME/.vim/snippets/c_while.cyi)/0Ncw "--------------------------------------------------------------------