-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy path.vimrc
executable file
·106 lines (91 loc) · 3.11 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
94
95
96
97
98
99
100
101
102
103
104
105
106
set nocompatible " be iMproved
filetype off " required!
" ====================== vundle
set rtp+=~/.vim/bundle/vundle/
call vundle#rc()
Bundle 'gmarik/vundle'
Bundle 'altercation/vim-colors-solarized'
Bundle 'plasticboy/vim-markdown'
Bundle 'mrtazz/vim-stencil'
Bundle 'airblade/vim-gitgutter'
" ====================== beahavior
filetype plugin on "load modules by file types
filetype indent on "indent by file types
set tabstop=4 "1tab = 4space
set shiftwidth=4 "1shift (>>) = 4space
set autoindent "same indent as previous line
set expandtab "spaces instead tabs
set hidden "hidden buffer instead close
set clipboard=unnamed "copy paste tmux
set noswapfile "disable swp files (proper edit)
set nowritebackup "disable backup files (proper edit)
set textwidth=0 "default textwidth
set modeline "use modeline settings if exist
set backspace=2 "make backspace work like most other apps
set viminfo="NONE"
set paste "https://stackoverflow.com/questions/2514445/turning-off-auto-indent-when-pasting-text-into-vim
" ====================== visual
syntax on "syntax highlighter
set number "line numbers
set nowrap "no wrap long lines
set visualbell "beep by flashing the screen
set ruler "line status
" ====================== themes
if has('gui_running')
set background=light
colorscheme solarized
else
set background=dark
endif
" ====================== auto paste
if &term =~ "xterm.*"
let &t_ti = &t_ti . "\e[?2004h"
let &t_te = "\e[?2004l" . &t_te
function XTermPasteBegin(ret)
set pastetoggle=<Esc>[201~
set paste
return a:ret
endfunction
map <expr> <Esc>[200~ XTermPasteBegin("i")
imap <expr> <Esc>[200~ XTermPasteBegin("")
cmap <Esc>[200~ <nop>
cmap <Esc>[201~ <nop>
endif
" ====================== spell (ctrl + F9)
if version >= 700
setlocal spell spelllang=
setlocal nospell
function ChangeSpellLang()
if &spelllang =~ "en_us"
setlocal spell spelllang=ru
echo "spelllang: ru"
elseif &spelllang =~ "ru"
setlocal spell spelllang=
setlocal nospell
echo "spelllang: off"
else
setlocal spell spelllang=en_us
echo "spelllang: en"
endif
endfunc
" map spell on/off for English/Russian
map <F9> <Esc>:call ChangeSpellLang()<CR>
endif
" ====================== tmux arrows working properly
if &term =~ '^screen'
" tmux will send xterm-style keys when xterm-keys is on
execute "set <xUp>=\e[1;*A"
execute "set <xDown>=\e[1;*B"
execute "set <xRight>=\e[1;*C"
execute "set <xLeft>=\e[1;*D"
endif
" ====================== ledger
let g:ledger_maxwidth = 80
" ====================== markdown
let g:vim_markdown_folding_disabled=1
" ====================== YouCompleteMe
let g:ycm_min_num_of_chars_for_completion = 1
" ====================== Disable .netrwhist
let g:netrw_dirhistmax = 0
" ====================== Stencil
let g:StencilTemplatepath = "~/.vim/templates/"