-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvimrc
More file actions
113 lines (100 loc) · 3.5 KB
/
Copy pathvimrc
File metadata and controls
113 lines (100 loc) · 3.5 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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
set nocompatible " not vi compatible
"--------------
" Load pathogen
"--------------
runtime bundle/vim-pathogen/autoload/pathogen.vim
call pathogen#infect()
call pathogen#helptags()
"------------------
" Syntax and indent
"------------------
syntax on " turn on syntax highlighting
set showmatch " show matching braces when text indicator is over them
" highlight current line, but only in active window
augroup CursorLineOnlyInActiveWindow
autocmd!
autocmd VimEnter,WinEnter,BufWinEnter * setlocal cursorline
autocmd WinLeave * setlocal nocursorline
augroup END
" vim can autodetect this based on $TERM (e.g. 'xterm-256color')
" but it can be set to force 256 colors
" set t_Co=256
if &t_Co < 256
colorscheme default
set nocursorline " looks bad in this mode
else
set background=light
let g:solarized_termcolors=256 " instead of 16 color with mapping in terminal
colorscheme solarized
" customized colors
highlight SignColumn ctermbg=234
highlight StatusLine cterm=bold ctermfg=245 ctermbg=235
highlight StatusLineNC cterm=bold ctermfg=245 ctermbg=235
let g:NeatStatusLine_color_normal='ctermfg=64 ctermbg=235 cterm=bold'
let g:NeatStatusLine_color_insert='ctermfg=136 ctermbg=235 cterm=bold'
let g:NeatStatusLine_color_replace='ctermfg=160 ctermbg=235 cterm=bold'
let g:NeatStatusLine_color_visual='ctermfg=33 ctermbg=235 cterm=bold'
let g:NeatStatusLine_color_position='ctermfg=245 ctermbg=235 cterm=bold'
let g:NeatStatusLine_color_modified='ctermfg=166 ctermbg=235 cterm=bold'
let g:NeatStatusLine_color_line='ctermfg=61 ctermbg=235 cterm=bold'
let g:NeatStatusLine_color_filetype='ctermfg=37 ctermbg=235 cterm=bold'
endif
filetype plugin indent on " enable file type detection
set autoindent
"---------------------
"" Basic editing config
"---------------------
set nu " number lines
set incsearch " incremental search (as string is being typed)
set hls " highlight search
exec "set listchars=tab:>>,nbsp:~"
set lbr " line break
set ruler " show current position in file
set scrolloff=5 " show lines above and below cursor (when possible)
set noshowmode " hide mode
set laststatus=2
set backspace=indent,eol,start " allow backspacing over everything
set timeout timeoutlen=1000 ttimeoutlen=100 " fix slow O inserts
set autochdir " automatically set current directory to directory of last opened file
set hidden " allow auto-hiding of edited buffers
set history=8192 " more history
set nojoinspaces " suppress inserting two spaces between sentences
" use 4 spaces instead of tabs during formatting
set expandtab
set tabstop=4
set shiftwidth=4
set softtabstop=4
" smart case-sensitive search
set ignorecase
set smartcase
" tab completion for files/bufferss
set wildmode=longest,list
set wildmenu
set mouse+=a " enable mouse mode (scrolling, selection, etc)
if &term =~ '^screen'
" tmux knows the extended mouse mode
set ttymouse=xterm2
endif
"--------------------
" Misc configurations
"--------------------
" open new split panes to right and bottom, which feels more natural
set splitbelow
set splitright
" quicker window movement
nnoremap <C-j> <C-w>j
nnoremap <C-k> <C-w>k
nnoremap <C-h> <C-w>h
nnoremap <C-l> <C-w>l
" disable arrow keys
nnoremap <Left> :echoe "Use h"<CR>
nnoremap <Right> :echoe "Use l"<CR>
nnoremap <Up> :echoe "Use k"<CR>
nnoremap <Down> :echoe "Use j"<CR>
" toggle relative numbering
nnoremap <C-n> :set rnu!<CR>
" save read-only files
command -nargs=0 Sudow w !sudo tee % >/dev/null
"---------------------
" Plugin configuration
"---------------------