Advertisement
vgl94

vimrc

Feb 26th, 2020
882
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
VIM 4.71 KB | None | 0 0
  1.  
  2. " automatically install vim plug
  3. if empty(glob('~/.vim/autoload/plug.vim'))
  4.   silent !curl -fLo ~/.vim/autoload/plug.vim --create-dirs
  5.     \ https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
  6.   autocmd VimEnter * PlugInstall --sync | source $MYVIMRC
  7. endif
  8.  
  9. " --------------------------------------------------------------------------
  10. "   PLUGINS
  11. " vim-plug plugin manager
  12. " download it first, by running the provided curl script
  13. call plug#begin()
  14.     Plug 'chriskempson/base16-vim'
  15.     Plug 'preservim/nerdcommenter' " automatic line commenter
  16.     Plug 'ycm-core/YouCompleteMe' " programming language syntax (YCM)
  17.     Plug 'sirver/ultisnips' " provides language syntax
  18.     "Plug 'airblade/vim-gitgutter' " marks line status in git
  19.     "Plug 'tpope/vim-repeat' " extend the '.' key
  20.     Plug 'preservim/nerdtree' " project tree
  21.     Plug 'scrooloose/syntastic' " syntax lightlights and error displays
  22.     Plug 'vim-airline/vim-airline' " fancy status bar and top buffer display
  23.     Plug 'vim-airline/vim-airline-themes'
  24.     Plug 'suoto/vim-hdl' " VHDL support
  25.     " leaving you to install FZF by youself!
  26.     "Plug 'junegunn/fzf' " fuzzy finder (terminal command)
  27.     "Plug 'junegunn/fzf.vim' " fzf configuration for VIM
  28.     Plug '/usr/local/fzf' " points to the FZF installation
  29.     Plug 'rbgrouleff/bclose.vim' " easy buffer delete
  30.     "Plug 'xuhdev/vim-latex-live-preview', { 'for': 'tex' } " live LaTeX preview (only in UNIX)
  31. call plug#end()
  32.  
  33. " --------------------------------------------------------------------------
  34. "   REGULAR SETTINGS
  35. set nu rnu ruler " set up line counter
  36. set tabstop=4 " tabs appear as 4 spaces
  37. set shiftwidth=4
  38. set softtabstop=0 " Setting this to a non-zero value other than tabstop will make the tab key (in insert mode) insert a combination of spaces (and possibly tabs) to simulate tab stops at this width.
  39. set noexpandtab " Enabling this will make the tab key (in insert mode) insert spaces instead of tab characters
  40. set showmatch " displays matching ([{...
  41. set mat=1 " 0.1s blink when matched
  42. set showcmd " displays incomplete commands
  43. set wildmenu " displays complete matches in a status line
  44. set cursorline " highlights current line
  45.  
  46. " theme configuration
  47. set t_Co=256
  48. let base16colorspace=256 " access colors present in 256 colorspace
  49. "colorscheme monokai-phoenix " commented out line 'hi Comment...'
  50. set background=dark
  51. " allows transparent background
  52. "hi Normal guibg=NONE ctermbg=NONE
  53.  
  54. filetype indent on
  55. filetype plugin on
  56. "syntax on " enable syntax window
  57.  
  58. set title " displays title in terminal header
  59. set encoding=utf-8 " UTF-8 encoding
  60. set ffs=unix,dos,mac " use UNIX standard file type
  61. set noswapfile " disable the creation of swap files (lock)
  62. set ai " auto indent
  63. set si " smart indent
  64. set wrap " wrap lines
  65.  
  66. " Return to last edit position when opening files (You want this!)
  67. autocmd BufReadPost *
  68.     \ if line("'\"") > 0 && line("'\"") <= line("$") |
  69.     \   exe "normal! g`\"" |
  70.     \ endif
  71.  
  72. set viminfo^=% " Remember info about open buffers on close
  73.  
  74. set incsearch hlsearch
  75. set nocompatible " VIM instead of Vi
  76. set listchars=eol:¶,trail:.,tab:→→,extends:>,precedes:<
  77. set list " activate listchars
  78. set autoindent " automatic indentation
  79. set backspace=2 " backspace in insert mode is normal, shorthand for: =indent,eol,start
  80. " disables syntax check for markdown
  81. "au BufRead *.md set ft=
  82.  
  83. " define leader key
  84. "let mapleader = "\"
  85.  
  86. " map 10 up-down
  87. noremap <C-k> : -10<CR> zz
  88. noremap <C-j> : +10<CR> zz
  89. " map ctrl-o to open line in normal mode
  90. nnoremap <c-o> o<esc>$d^
  91.  
  92. " Live LaTeX preview
  93. "nnoremap <F1> :LLPStartPreview<CR>
  94.  
  95. " buffer operations
  96. noremap <F3> :bn!<CR>
  97. noremap <F2> :bp!<CR>
  98. noremap <F4> :Bclose<CR>
  99.  
  100. " split windows switching
  101. "noremap <F12> <C-w>w
  102.  
  103. " remap Y to y$, like C is c$
  104. noremap Y y$
  105.  
  106. " disable some default maps
  107. map + <Nop>
  108. map - <Nop>
  109. map <s-k> <Nop>
  110. map <c-b> <Nop>
  111.  
  112. "       Fuzzy finder
  113. "nmap <leader>f : Files<CR>
  114. " leaving you to install FZF by youself!
  115. nmap <leader>f : FZF<CR>
  116.  
  117. "       Gitgutter
  118. "autocmd vimenter * GitGutterEnable " Not to be confused with GitGutterBufferEnable
  119.  
  120. "   vim-airline
  121. let g:airline_theme='dark'
  122. " if not correctly displayed, please install powerline fonts
  123. let g:airline_powerline_fonts = 1
  124. "let g:airline_left_sep = '⮀'
  125. "let g:airline_left_alt_sep = '⮁'
  126. "let g:airline_right_sep = '⮂'
  127. "let g:airline_right_alt_sep = '⮃' " enables tabline
  128.  
  129. let g:airline#extensions#tabline#enabled = 1
  130. "let g:airline#extensions#tabline#left_sep = '⮀'
  131. "let g:airline#extensions#tabline#left_alt_sep = '⮀'
  132.  
  133. "       NERDtree
  134. let NERDTreeIgnore = ['\.pyc$', '\.o$', '\.out$']
  135. nmap <leader>tt :NERDTreeToggle<CR>
  136. "       You Complete Me
  137. " unecessary for regular syntax search
  138. "let g:ycm_global_ycm_extra_conf = "~/.dotfiles/.vim/ycm_extra_conf.py"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement