-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvimrc
More file actions
82 lines (65 loc) · 2.01 KB
/
Copy pathvimrc
File metadata and controls
82 lines (65 loc) · 2.01 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
runtime bundle/vim-pathogen/autoload/pathogen.vim
execute pathogen#infect()
if !exists("g:os")
if has("win64") || has("win32") || has("win16")
let g:os = "Windows"
else
let g:os = substitute(system('uname'), '\n', '', '')
endif
endif
" utf-8
set encoding=utf-8
scriptencoding utf-8
" fancy text wrap
if has("patch-7.4.354")
set breakindent
endif
set showbreak=⤷\
" Russian with Ctrl+^
if g:os == "Darwin"
set keymap=russian-jcukenmac
else
set keymap=russian-jcukenwin
endif
set iminsert=0
set imsearch=0
" highlight lCursor guifg=NONE guibg=Cyan " highlight cursor
" numbers
" set number
" virtual space
set virtualedit=block
" tab size
set tabstop=4 " tab == 4 spaces
set shiftwidth=4
set softtabstop=4
set expandtab
" stop nagging about unsaved buffers!
set hidden
" my dotfiles manager configs
" au BufNewFile,BufRead dfscheme set filetype=json
" colorscheme
" cf. https://github.com/altercation/vim-colors-solarized
set background=dark
colorscheme solarized
" paste toggle (no more weirndess when pasting to console vim!)
set pastetoggle=<F5>
set wildignore+=*.pyc,*.o,*.obj,*.svn,*.swp,*.class,*.hg,*.DS_Store,*.min.*,*.egg-info
" hide stuff from NERDTree
let NERDTreeRespectWildIgnore=1
augroup vimrc
" Automatically delete trailing DOS-returns and whitespace on file open and
" write.
autocmd BufRead,BufWritePre,FileWritePre * silent! %s/[\r \t]\+$//
augroup END
" line limiter
set colorcolumn=80
" NERDTree
" Most of these come from official README:
" https://github.com/preservim/nerdtree
nnoremap <F2> :NERDTreeToggle<CR>
" If another buffer tries to replace NERDTree, put it in the other window, and bring back NERDTree.
autocmd BufEnter * if bufname('#') =~ 'NERD_tree_\d\+' && bufname('%') !~ 'NERD_tree_\d\+' && winnr('$') > 1 |
\ let buf=bufnr() | buffer# | execute "normal! \<C-W>w" | execute 'buffer'.buf | endif
" Exit Vim if NERDTree is the only window left.
autocmd BufEnter * if tabpagenr('$') == 1 && winnr('$') == 1 && exists('b:NERDTree') && b:NERDTree.isTabTree() |
\ quit | endif