-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvimrc
More file actions
71 lines (59 loc) · 3 KB
/
Copy pathvimrc
File metadata and controls
71 lines (59 loc) · 3 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
" ============================================================
" This vimrc requires vim with +eval feature (not vim-tiny).
" If you see errors below, run: sudo apt install vim
" ============================================================
silent! call pathogen#infect()
set nocompatible " choose no compatibility with legacy vi
silent! syntax enable
set background=dark
set t_Co=256
set encoding=utf-8 " use utf-8 for internally
set ruler
set showcmd " display incomplete commands
silent! filetype plugin indent on " load file type plugins + indentation
"" Whitespace
set nowrap " don't wrap lines
set tabstop=2 shiftwidth=2 " a tab is two spaces (or set this to 4)
set expandtab " use spaces, not tabs (optional)
set backspace=indent,eol,start " backspace through everything in insert mode
"" Leader key
silent! let mapleader = ","
"" Searching
" turn off vim's handling of regex in searches
silent! nnoremap / /\v
silent! vnoremap / /\v
set hlsearch " highlight matches
set incsearch " incremental searching
set ignorecase " searches are case insensitive...
set smartcase " ... unless they contain at least one capital letter
set gdefault " apply substitutions globally on lines
" shortcut to clear search
silent! nnoremap <leader><space> :noh<cr>
""List chars
set listchars="" " Reset the listchars
set listchars=tab:\ \ " a tab should display as " ", trailing whitespace as "."
set listchars+=trail:. " show trailing spaces as dots
set listchars+=extends:> " The character to show in the last column when wrap is
" off and the line continues beyond the right of the screen
set listchars+=precedes:< " The character to show in the first column when wrap is
" off and the line continues beyond the left of the screen
silent! if has("statusline") && !&cp
set laststatus=2 " always show the status bar
set statusline=%t " tail of the filename
set statusline+=[%{strlen(&fenc)?&fenc:'none'}, " file encoding
set statusline+=%{&ff}] " file format
set statusline+=%h " help file flag
set statusline+=%m " modified flag
set statusline+=%r " readonly flag
set statusline+=%y " filetype
set statusline+=%= " left/right separator
set statusline+=%c, " cursor column
set statusline+=%l/%L " cursor line/total lines
set statusline+=\ %P " percent through file
endif
"" ignore generated and binary files in auto-completion
set wildignore+=*.so,*.class,*.o,*.jar,*.swp,*.zip
"" search from root of project
silent! let g:ctrlp_working_path_mode = 'ra'
" Let ctrlp search based on git index, honoring gitignore files
silent! let g:ctrlp_user_command = ['.git/', 'cd %s && git ls-files --exclude-standard -co']