Skip to content

Instantly share code, notes, and snippets.

@rchatsiri
Created July 6, 2019 13:50
Show Gist options
  • Save rchatsiri/c78996afe2afbf1ec3e6786331b625ac to your computer and use it in GitHub Desktop.
Save rchatsiri/c78996afe2afbf1ec3e6786331b625ac to your computer and use it in GitHub Desktop.
Vim profile for github
set nu
set encoding=utf-8
set nocompatible " be iMproved, required
filetype off " required
" et 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
Plugin 'VundleVim/Vundle.vim'
" The following are examples of different formats supported.
" Keep Plugin commands between vundle#begin/end.
" plugin on GitHub repo
Plugin 'https://github.com/Valloric/YouCompleteMe.git'
Plugin 'https://github.com/vim-scripts/The-NERD-tree.git'
Plugin 'https://github.com/vim-airline/vim-airline.git'
Plugin 'vim-airline/vim-airline-themes'
" Support Rust
Plugin 'rust-lang/rust.vim'
Plugin 'prabirshrestha/async.vim'
Plugin 'prabirshrestha/vim-lsp'
Plugin 'prabirshrestha/asyncomplete.vim'
Plugin 'prabirshrestha/asyncomplete-lsp.vim'
" Install L9 and avoid a Naming conflict if you've already installed a
" different version somewhere else.
" Plugin 'ascenator/L9', {'name': 'newL9'}
" All of your Plugins must be added before the following line
call vundle#end() " required
filetype plugin indent on " required
nnoremap <silent> <c-n> :NERDTreeToggle<cr>
" map move split windows
:map <leader>j <C-W>w
" Save file
map <F4> :w <CR>
" Tab navigation like Firefox.
nmap <leader>k :bnext<CR>
nmap <leader>l :bprevious<CR>
" format cpp file.
nmap <F5> :!./formatt_code.sh '%:p'<CR>
" delete recovery file
nmap <F7> :!rm '%:p:h'/.'%:t'.swp <CR>
" Delete whitespace
autocmd BufWritePre * %s/\s\+$//e
let g:airline#extensions#tabline#enabled = 1
" auto brackets
inoremap " ""<left>
inoremap ' ''<left>
inoremap ( ()<left>
inoremap [ []<left>
inoremap { {}<left>
inoremap {<CR> {<CR>}<ESC>O
inoremap {;<CR> {<CR>};<ESC>O
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment