-
Notifications
You must be signed in to change notification settings - Fork 0
/
vimrc
92 lines (71 loc) · 1.56 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
set nocompatible
" Other stuff
set expandtab
set tabstop=4
set shiftwidth=4
set autoindent
set smartindent
set bg=dark
set nowrap
set title
set number
set ruler
set relativenumber
set scrolloff=4
set sidescrolloff=8
set undofile
set undodir=~/.vimlocal/undo
set nobackup
set dir=~/.vimlocal/swap
set wildmenu
set wildmode=list:longest
set wildchar=<Tab>
set ignorecase
set incsearch
set hlsearch
set smartcase
set matchpairs+=<:>
set nowrap
set virtualedit=onemore,block
" Extra stuff
set colorcolumn=+1
highlight ColorColumn ctermbg=darkgrey
nnoremap <C-M> :nohlsearch<CR><C-M>
" let g:mapleader = "\<space>"
" let mapleader = g:mapleader
vnoremap / /\v
nnoremap / /\v
vnoremap ? ?\v
nnoremap ? ?\v
" imap jk <Esc>
inoremap jk <Esc>
" Splits
nnoremap <C-J> <C-W><C-J>
nnoremap <C-K> <C-W><C-K>
nnoremap <C-L> <C-W><C-L>
nnoremap <C-H> <C-W><C-H>
set splitbelow
set splitright
nnoremap Y y$
" noremap <silent> <Space> :silent nohl<Bar>echo<CR>
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()
if &term =~ '^\(xterm\|screen\|screen-256color\|rxvt\|rxvt-unicode\)' && $COLORTERM == 'gnome-terminal'
set t_Co=256
endif
filetype plugin indent on
syntax on