-
Notifications
You must be signed in to change notification settings - Fork 0
/
.vimrc
150 lines (119 loc) · 3.54 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
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
" NOTE: neovim is the primary text editor which is configured elsewhere, so
" this config is only used in the occasional times vim is used instead.
set nocompatible
" ================ General Config ====================
set number "Line numbers are good
set relativenumber "Relative line numbers are good
set backspace=indent,eol,start "Allow backspace in insert mode
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 autoread "Reload files changed outside vim
set nowrap "Don't wrap lines
" set linebreak "Wrap lines at convenient points
" ================ Indentation ======================
set autoindent
set smartindent
set smarttab
set shiftwidth=2
set softtabstop=2
set tabstop=2
set expandtab
augroup markdown
autocmd!
autocmd FileType markdown setlocal shiftwidth=2 tabstop=2
autocmd ColorScheme retrobox hi Normal guibg=NONE ctermbg=NONE
augroup END
" This makes vim act like all other editors, buffers can
" exist in the background without being in a window.
" http://items.sjbach.com/319/configuring-vim-right
set hidden
set mouse=a
set ignorecase
set smartcase
set nofoldenable "dont fold by default
" ================ Completion =======================
set wildmode=list:longest
set wildmenu "enable ctrl-n and ctrl-p to scroll thru matches
" filetype plugin on
" filetype indent on
" Display tabs and trailing spaces visually
set list listchars=tab:\ \ ,trail:·
" set swap file directory relative to home, instead of working directory
" be sure the directory exists
set directory^=$HOME/.vim/tmp//
" Some servers have issues with backup files, see #649
set nobackup
set nowritebackup
" Better display for messages
set cmdheight=2
" You will have bad experience for diagnostic messages when it's default 4000.
set updatetime=300
" don't give |ins-completion-menu| messages.
set shortmess+=c
" always show signcolumns
set signcolumn=yes
" ================ Search ===========================
set incsearch " Find the next match as we type the search
set hlsearch " Highlight searches by default
set ignorecase " Ignore case when searching...
set smartcase " ...unless we type a capital
" ================ Security ==========================
set modelines=0
set nomodeline
"nnoremap <silent> Q :bdelete<CR>
"
"
"
"
"" ," Surround a word with "quotes"
"map ," ysiw"
"vmap ," c"<C-R>""<ESC>
"
"" ,' Surround a word with 'single quotes'
"map ,' ysiw'
"vmap ,' c'<C-R>"'<ESC>
"
"" ,) or ,( Surround a word with (parens)
"" The difference is in whether a space is put in
"map ,( ysiw(
"map ,) ysiw)
"vmap ,( c( <C-R>" )<ESC>
"vmap ,) c(<C-R>")<ESC>
"
"" ,[ Surround a word with [brackets]
"map ,] ysiw]
"map ,[ ysiw[
"vmap ,[ c[ <C-R>" ]<ESC>
"vmap ,] c[<C-R>"]<ESC>
"
"" ,{ Surround a word with {braces}
"map ,} ysiw}
"map ,{ ysiw{
"vmap ,} c{ <C-R>" }<ESC>
"vmap ,{ c{<C-R>"}<ESC>
"
"map ,` ysiw`
"
"
"
"
"" Change inside various enclosures with Cmd-" and Cmd-'
"" The f makes it find the enclosure so you don't have
"" to be standing inside it
"nnoremap <M-'> f'ci'
"nnoremap <M-"> f"ci"
"nnoremap <M-(> f(ci(
"nnoremap <M-)> f)ci)
"nnoremap <M-[> f[ci[
"nnoremap <M-]> f]ci]
au FocusGained,BufEnter * :checktime
"if (has("nvim"))
" let $NVIM_TUI_ENABLE_TRUE_COLOR=1
"endif
if (has("termguicolors"))
set termguicolors
endif
syntax on
colorscheme retrobox
set background=dark