Advertisement
Guest User

vimrc

a guest
Dec 13th, 2017
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
VIM 10.01 KB | None | 0 0
  1. ""++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++"
  2. "                                                                                                "
  3. "                                          .::::.                                                "
  4. "                             ___________ :;;;;:`____________                                    "
  5. "                             \_________/ ?????L \__________/                                    "
  6. "                               |.....| ????????> :.......'                                      "
  7. "                               |:::::| $$$$$$"`.:::::::' ,                                      "
  8. "                              ,|:::::| $$$$"`.:::::::' .OOS.                                    "
  9. "                            ,7D|;;;;;| $$"`.;;;;;;;' .OOO888S.                                  "
  10. "                          .GDDD|;;;;;| ?`.;;;;;;;' .OO8DDDDDNNS.                                "
  11. "                           'DDO|IIIII| .7IIIII7' .DDDDDDDDNNNF`                                 "
  12. "                             'D|IIIIII7IIIII7' .DDDDDDDDNNNF`                                   "
  13. "                               |EEEEEEEEEE7' .DDDDDDDNNNNF`                                     "
  14. "                               |EEEEEEEEZ' .DDDDDDDDNNNF`                                       "
  15. "                               |888888Z' .DDDDDDDDNNNF`                                         "
  16. "                               |8888Z' ,DDDDDDDNNNNF`                                           "
  17. "                               |88Z'    "DNNNNNNN"                                              "
  18. "                               '"'        "MMMM"                                                "
  19. "                                            ""                                                  "
  20. "                                                                                                "
  21. "      ___    ____                                            __   _         _    ________  ___  "
  22. "     /   |  / / /  __  ______  __  __   ____  ___  ___  ____/ /  (_)____   | |  / /  _/  |/  /  "
  23. "    / /| | / / /  / / / / __ \/ / / /  / __ \/ _ \/ _ \/ __  /  / / ___/   | | / // // /|_/ /   "
  24. "   / ___ |/ / /  / /_/ / /_/ / /_/ /  / / / /  __/  __/ /_/ /  / (__  )    | |/ // // /  / /    "
  25. "  /_/  |_/_/_/   \__, /\____/\__,_/  /_/ /_/\___/\___/\__,_/  /_/____/     |___/___/_/  /_/     "
  26. "                   /_/                                                                          "
  27. "++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++"
  28.  
  29. " Plugin Inicialization ==================="{{{
  30. call plug#begin('~/.vim/plugged')
  31.  
  32. " Plugins
  33.  Plug 'tpope/vim-surround'
  34.  Plug 'flazz/vim-colorschemes'
  35.  Plug 'bronson/vim-trailing-whitespace'
  36.  Plug 'morhetz/gruvbox'
  37.  Plug 'chriskempson/base16-vim'
  38.  Plug 'scrooloose/nerdtree', { 'on': 'NERDTreeToggle' }
  39.  Plug 'lucasteles/SWTC.Vim', { 'on': 'SWTC .vim/plugged/SWTC.vim/intro.swtc' }
  40.  Plug 'arithran/vim-pizza' , { 'on': 'OrderPizza' }
  41.  "Plug 'terryma/vim-multiple-cursors'
  42.  "Plug 'ludovicchabant/vim-gutentags'
  43.  "Plug 'rking/ag.vim'
  44.  "Plug 'tpope/vim-fugitive'
  45.  "Plug 'hzchirs/vim-material'
  46.  
  47. " Tmux
  48.  "Plug 'christoomey/vim-tmux-navigator'
  49.  "Plug 'jgdavey/tslime.vim'
  50.  "Plug 'jpalardy/vim-slime'
  51.  
  52. " Languages
  53.  "Plug 'python-mode/python-mode'
  54.  
  55. call plug#end()"}}}
  56. " General Settings ========================"{{{
  57. " Force read encoding
  58.  set encoding=utf-8
  59. " To work cool, disable compatibility with Vi
  60.  set nocompatible
  61. " Set the runtime path to include Vundle and initialize
  62.  set mouse=
  63.  set background=dark
  64.  " Disable cursor blink
  65.  set gcr=a:blinkon0
  66. " Move the cursor to the matched string
  67.  set incsearch
  68. " Search highlight
  69.  set hlsearch
  70. " Search ignore case
  71.  set ignorecase
  72. " Search do not wrap around
  73.  set nowrap
  74. " Start scrolling 5 lines before the horizontal window border
  75.  set scrolloff=5
  76. " Avoid lags
  77.  set lazyredraw
  78. " Line numbers options
  79.  set number
  80.  set relativenumber
  81.  set numberwidth=4
  82. " To display the status line always
  83.  set laststatus=2
  84. " Dont unload buffers
  85.  set hidden
  86. " New window is put below the current one
  87.  set splitbelow
  88. " New window is put right of the current one
  89.  set splitright
  90. " Show commands
  91.  set showcmd
  92. " Hide mode status (INSERT, VISUAL)
  93.  set showmode
  94. " Show the cursor position
  95.  set ruler
  96. " Allow backspace in insert mode
  97.  set backspace=start,eol,indent
  98. " Reduce the need for % in matching
  99.  set showmatch
  100.  set matchtime=2
  101. " Tab characters entered will be changed to spaces
  102.  set expandtab
  103. " Number of space characters inserted for indentation
  104.  set shiftwidth=4
  105.  set softtabstop=4
  106. " Modelines off
  107.  set nomodeline
  108.  set modelines=0
  109. " Avoid creation of * .ext files
  110.  set nowritebackup
  111.  set nobackup
  112.  set noswapfile
  113. " Automatically read changes
  114.  set autoread
  115. " Hidden buffer instead of close
  116.  set hidden
  117. " Increase history
  118.  set history=50
  119. " Correct vim colors in tmux
  120.  set t_Co=256
  121. " Ignore some directories
  122.  set wildignore+=**/node_modules,**/bower_components,**/tmp,**/vendor,**/git
  123. " Python mode disable some things
  124.  "let g:pymode_options_colorcolumn = 0
  125.  "let g:pymode_lint = 0
  126.  "let g:pymode_run = 0
  127.  "let g:pymode_virtualenv = 0
  128.  "let g:pymode_doc = 0
  129.  "let g:pymode_folding = 0
  130.  "let g:pymode_rope = 0
  131. " Vim slime with tmux
  132.  let g:slime_target = "tmux"
  133.  let g:slime_paste_file = "$HOME/.slime_paste"
  134. " Remove all trailing whitespaces at save
  135.  autocmd BufWritePre * :%s/\s\+$//e
  136. " Search down into subfolders
  137. " Provides tab-completion for all file-related tasks
  138. set path+=**
  139.  
  140. " Display all matching files when we tab complete
  141. set wildmenu
  142.  
  143.  "}}}
  144. " Folding ================================="{{{
  145.  set foldenable
  146.  set foldmethod=marker
  147.  set foldlevel=999
  148.  set foldmarker={{{,}}}
  149.  
  150. "Maps for folding
  151.  nnoremap <leader>ff za
  152.  nnoremap <leader>FF zA
  153.  nnoremap <LEADER>fu zM<CR>
  154.  nnoremap <LEADER>uf zR<CR>
  155.  augroup AutoSaveFolds
  156.  autocmd!
  157.  autocmd BufWinLeave *.* mkview
  158.  autocmd BufWinEnter *.* silent loadview
  159.  augroup END
  160.  "}}}
  161. "{{{ Statusline ==============================
  162.  
  163. set statusline=%!MyStatusLine()
  164.  
  165. function! MyStatusLine()
  166.   let statusline = ""
  167.    " Filename (F -> full, f -> relative)
  168.    let statusline .= "\%f"
  169.   " Buffer flags
  170.    let statusline .= "%( %h%1*%m%*%r%w%) "
  171.    " File format and type
  172.    let statusline .= "(%{&ff}%(\/%Y%))"
  173.   " Left/right separator
  174.    let statusline .= "%="
  175.   " Line & column
  176.    let statusline .= "(%l,%c%V) "
  177.    " Character under cursor (decimal)
  178.    let statusline .= "%03.3b "
  179.    " Character under cursor (hexadecimal)
  180.    let statusline .= "0x%02.2B "
  181.    " File progress
  182.    let statusline .= "| %P/%L"
  183.    return statusline
  184. endfunction
  185.  
  186. "}}}
  187. "{{{ NERDTree ================================
  188.  let NERDTreeShowBookmarks=1
  189.  let NERDTreeMinimalUI = 0
  190.  let g:NERDTreeFileExtensionHighlightFullName = 1
  191.  let g:NERDTreeExactMatchHighlightFullName = 1
  192.  let g:NERDTreePatternMatchHighlightFullName = 1
  193.  let g:NERDTreeHighlightFolders = 1 " enables folder icon highlighting using exact match
  194.  let g:NERDTreeHighlightFoldersFullName = 1 " highlights the folder name
  195.  let NERDTreeIgnore=['\.o$', '\~$']
  196.  let NERDTreeIgnore=['node_modules', 'bower_components', 'tmp', 'vendor', 'tags', '\.o$', '\~$']
  197. " Toggle NERDTree
  198.  nmap <silent> <Leader>nt :NERDTreeToggle<CR>
  199. "}}}
  200. "{{{ Syntastic ===============================
  201. let g:syntastic_error_symbol = ''
  202. let g:syntastic_warning_symbol = ''
  203. let g:syntastic_check_on_wq = 0
  204. let g:syntastic_check_on_open = 1
  205. let g:syntastic_auto_loc_list = 1
  206. let g:syntastic_c_checkers = ['gcc', 'make']
  207. let g:syntastic_always_populate_loc_list = 1
  208. let g:syntastic_auto_jump = 1
  209. let g:syntastic_loc_list_height = 3"}}}
  210. "{{{ GUI Options =============================
  211. " Gui size
  212.  if has("gui_running")
  213.  " GUI is running or is about to start.
  214.  " Maximize gvim window (for an alternative on Windows, see simalt below).
  215.  set lines=999
  216.  set columns=999
  217.  colorscheme gruvbox
  218.  else
  219.  " This is console Vim.
  220.  colorscheme base16-default-dark
  221.  if exists("+lines")
  222.    set lines=39
  223.  endif
  224.  if exists("+columns")
  225.    set columns=133
  226.  endif
  227.  endif
  228.  
  229. " Remove Bars
  230.  set guioptions-=T
  231.  set guioptions-=t
  232.  set guioptions-=m
  233.  set guioptions-=L
  234.  set guioptions-=l
  235.  set guioptions-=r
  236. "}}}
  237. "{{{ Maps ====================================
  238. " Space as leader
  239.  map <Space> <leader>
  240. "Clean search
  241.  nmap <leader>hl :nohlsearch<CR>
  242. " Open a new empty buffer
  243.  nmap <leader>N :enew<cr>
  244. " Move to the next buffer
  245.  nmap <leader>n :bnext<CR>
  246. " Move to the previous buffer
  247.  nmap <leader>p :bprevious<CR>
  248. " Move to the previous buffer
  249.  nmap <leader>D :bdelete<CR>
  250. " Close the current buffer and move to the previous one
  251.  nmap <leader>bq :bp <TAB> bd #<CR>
  252. " Show all open buffers and their status
  253.  nmap <leader>ls :ls<CR>
  254. " Run .c map
  255.  map <F8> :!gcc % -o %< -lm && ./%< <CR>
  256. " Disable Arrow keys in Escape mode
  257.  map <up> <nop>
  258.  map <down> <nop>
  259.  map <left> <nop>
  260.  map <right> <nop>
  261. " Window buffer navigation
  262.  map <C-h> <C-w>h
  263.  map <C-j> <C-w>j
  264.  map <C-k> <C-w>k
  265.  map <C-l> <C-w>l
  266. " Ctrl C + Ctrl V
  267.  vmap <C-c> "+y
  268.  vmap <C-x> "+c
  269.  vmap <C-v> c<ESC>"+p
  270.  imap <C-v> <C-r><C-o>+
  271. " Quit
  272.  inoremap <C-Q>     <esc>:q<cr>
  273.  nnoremap <C-Q>     :q<cr>
  274.  vnoremap <C-Q>     <esc>
  275.  nnoremap <Leader>q :q<cr>
  276.  nnoremap <Leader>Q :qa!<cr>
  277. " Quickly edit/reload the vimrc file
  278.  nmap <silent> <leader>ev :e $MYVIMRC<CR>
  279.  nmap <silent> <leader>sv :so $MYVIMRC<CR>
  280. " Run shell command
  281.  nnoremap <F9> :!bash<CR>
  282. " Quick search/replace:
  283.  nnoremap <Space><Space> :'{,'}s/\<<C-r>=expand('<cword>')<CR>\>/
  284.  nnoremap <Space>%       :%s/\<<C-r>=expand('<cword>')<CR>\>/
  285. " Autoclosing
  286.  inoremap (<CR> (<CR>)<Esc>O
  287.  inoremap {<CR> {<CR>}<Esc>O
  288.  inoremap {; {<CR>};<Esc>O
  289.  inoremap {, {<CR>},<Esc>O
  290.  inoremap [<CR> [<CR>]<Esc>O
  291.  inoremap [; [<CR>];<Esc>O
  292.  inoremap [, [<CR>],<Esc>O
  293.  "}}}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement