-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvimrc
93 lines (67 loc) · 2.15 KB
/
vimrc
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
set nocompatible "use vim settings, rather than vi settings
call pathogen#infect() "activate pathogen
"allow backspacing over everything in insert mode
set backspace=indent,eol,start
set history=1000 "store lots of :cmdline history
set showcmd "show incomplete cmds down the bottom
set showmode "show current mode down the bottom
set number "show line numbers
set incsearch "find the next match as we type the search
set hlsearch "hilight searches by default
set wrap "dont wrap lines
set linebreak "wrap lines at convenient points
if v:version >= 703
"undo settings
set undodir=~/.vim/undofiles
set undofile
set colorcolumn=+1 "mark the ideal max text width
endif
"default indent settings
set shiftwidth=4
set softtabstop=4
set tabstop=4
set expandtab
set autoindent
"folding settings
set foldmethod=indent "fold based on indent
set foldnestmax=3 "deepest fold is 3 levels
set nofoldenable "dont fold by default
set wildmode=list:longest "make cmdline tab completion similar to bash
set wildmenu "enable ctrl-n and ctrl-p to scroll thru matches
set wildignore=*.o,*.obj,*~ "stuff to ignore when tab completing
set formatoptions-=o "dont continue comments when pushing o/O
"vertical/horizontal scroll off settings
set scrolloff=3
set sidescrolloff=7
set sidescroll=1
"load ftplugins and indent files
filetype plugin on
filetype indent on
"turn on syntax highlighting
syntax on
"set text colorscheme
set background=dark
colorscheme solarized
"set statusline style
set laststatus=2
let g:lightline = {}
let g:lightline.colorscheme = 'solarized'
"auto enable paste mode
function! WrapForTmux(s)
if !exists('$TMUX')
return a:s
endif
let tmux_start = "\<Esc>Ptmux;"
let tmux_end = "\<Esc>\\"
return tmux_start . substitute(a:s, "\<Esc>", "\<Esc>\<Esc>", 'g') . tmux_end
endfunction
let &t_SI .= WrapForTmux("\<Esc>[?2004h")
let &t_EI .= WrapForTmux("\<Esc>[?2004l")
function! XTermPasteBegin()
set pastetoggle=<Esc>[201~
set paste
return ""
endfunction
inoremap <special> <expr> <Esc>[200~ XTermPasteBegin()
noremap <Leader>r ggg?G``
autocmd FileType yaml setlocal ts=2 sts=2 sw=2 expandtab