Rockstable Wiki:

vim

Basic Adjustments

You can override /etc/vim/vimrc with /etc/vim/vimrc.local Create a local copy of /etc/vim/vimrc to let maintainer provide more distribution vimrc, that we don't want to interact during system upgrades. Try to acomplish this in vim itself, because a simple copy will create a ugly source recursion.

   1 % sudo vim /etc/vim/vimrc
   2 ### THEN TYPE:
   3 :% yank
   4 :vsp /etc/vim/vimrc.local
   5 P
   6 /" Source
   7 VGd
   8 :w
   9 

or just simply copy it and deal with the error

   1 cp /etc/vim/vimrc{,.local}

Configure vim globally:

/etc/vim/vimrc.local

   1 " All system-wide defaults are set in $VIMRUNTIME/debian.vim and sourced by
   2 " the call to :runtime you can find below.  If you wish to change any of those
   3 " settings, you should do it in this file (/etc/vim/vimrc), since debian.vim
   4 " will be overwritten everytime an upgrade of the vim packages is performed.
   5 " It is recommended to make changes after sourcing debian.vim since it alters
   6 " the value of the 'compatible' option.
   7 
   8 " This line should not be removed as it ensures that various options are
   9 " properly set to work with the Vim-related packages available in Debian.
  10 runtime! debian.vim
  11 
  12 " Vim will load $VIMRUNTIME/defaults.vim if the user does not have a vimrc.
  13 " This happens after /etc/vim/vimrc(.local) are loaded, so it will override
  14 " any settings in these files.
  15 " If you don't want that to happen, uncomment the below line to prevent
  16 " defaults.vim from being loaded.
  17 let g:skip_defaults_vim = 1
  18 
  19 " Uncomment the next line to make Vim more Vi-compatible
  20 " NOTE: debian.vim sets 'nocompatible'.  Setting 'compatible' changes numerous
  21 " options, so any other options should be set AFTER setting 'compatible'.
  22 "set compatible
  23 
  24 " Vim5 and later versions support syntax highlighting. Uncommenting the next
  25 " line enables syntax highlighting by default.
  26 syntax on
  27 
  28 " If using a dark background within the editing area and syntax highlighting
  29 " turn on this option as well
  30 set background=dark
  31 
  32 " Uncomment the following to have Vim jump to the last position when
  33 " reopening a file
  34 au BufReadPost * if line("'\"") > 1 && line("'\"") <= line("$") | exe "normal! g'\"" | endif
  35 
  36 " Uncomment the following to have Vim load indentation rules and plugins
  37 " according to the detected filetype.
  38 filetype plugin indent on
  39 
  40 " The following are commented out as they cause vim to behave a lot
  41 " differently from regular Vi. They are highly recommended though.
  42 set showcmd             " Show (partial) command in status line.
  43 set showmatch           " Show matching brackets.
  44 "set ignorecase         " Do case insensitive matching
  45 "set smartcase          " Do smart case matching
  46 "set incsearch          " Incremental search
  47 "set autowrite          " Automatically save before commands like :next and :make
  48 "set hidden             " Hide buffers when they are abandoned
  49 "set mouse=a            " Enable mouse usage (all modes)

vim-pathogen

   1 aptitude install vim-pathogen

~/.vimrc

   1 execute pathogen#infect()

vim-youcompleteme

   1 aptitude install vim-youcompleteme

~/.vimrc

   1 """ youcompleteme
   2 "let g:ycm_key_list_select_completion = ['<TAB>', '<Down>']
   3 "let g:ycm_key_list_previous_completion = ['<S-TAB>', '<Up>']
   4 "let g:ycm_key_list_stop_completion = ['<C-y>']
   5 let g:ycm_key_invoke_completion = '<C-Space>'

vim-syntastic

   1 aptitude install vim-syntastic

nerdtree

   1 cd
   2 mkdir -p ~/.vim/bundle
   3 cd ~/.vim/bundle
   4 git clone https://github.com/scrooloose/nerdtree.git

~/.vimrc

   1 """ NERDTree
   2 autocmd StdinReadPre * let s:std_in=1
   3 autocmd VimEnter * if argc() == 0 && !exists("s:std_in") | NERDTree | endif
   4 
   5 "map <C-n> :NERDTreeToggle<CR>
   6 map <F2> :NERDTreeToggle<CR>

nerdtree-git-plugin

   1 cd ~/.vim/bundle
   2 git clone https://github.com/Xuyuanp/nerdtree-git-plugin.git

Rockstable Wiki: vim (last edited 2020-03-16 20:16:46 by RockStable)