-
Notifications
You must be signed in to change notification settings - Fork 0
/
.vimrc
109 lines (91 loc) · 4.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
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
set background=dark
set nocompatible " disable vi compatibility, idk what this does
set noswapfile " no temp file
set backspace=indent,eol,start " allow backspace over everything
set number " show line numbers
set showmatch " show matching parenthesis
set showcmd " show commands which i'm typing
set cursorline " highlight cursor
set title " set terminal title
set history=1000
set undolevels=1000
set lazyredraw " buffer screen updates
set clipboard+=unnamedplus " copy to system clipboard
set updatetime=250
filetype plugin indent on " file type detection on (allows syntax highlighting etc)
syntax enable " enable syntax highligting
" show all invisible characters {{
set listchars=tab:‣\ ,trail:␣,extends:#,nbsp:·
set list "}}
" search settings {{
set ignorecase " ignore case for search
set smartcase " but if there is an uppercase then search is case sensitive
set incsearch " incremental search
set hlsearch " highlight search as I type }}
" tabs {{
set tabstop=2 " tab is 2 spaces by default
set autoindent " new lines indented automatically
set copyindent " indents are copied
set smarttab " }}
" fold syntax by default {{
set foldenable
set foldmethod=syntax
set foldlevel=5
set fillchars=fold:\
" }}
" autocompletion for vim commands {{
set wildmenu
set wildoptions=pum
set wildignorecase "}}
" enable mouse {{
if !has('nvim')
set ttymouse=xterm2
endif
set mouse=a "}}
" tmux integration {{
augroup tmux
autocmd!
if exists('$TMUX')
autocmd BufReadPost,FileReadPost,BufNewFile * call system("tmux rename-window " . expand("%:t"))
autocmd VimLeave * call system("tmux set-window-option automatic-rename")
endif
augroup END "}}
" no beeps {{
set visualbell
set noerrorbells "}}
" line wrapping {{
set wrap " wrap long lines
set breakindent " indent at same level as rapped line }}
" enable modeline and settings, to let vim be controlled by last line comment {{
set modeline
set modelineexpr " }}
" vim plugin management {{
if empty(glob('~/.vim/autoload/plug.vim'))
silent !curl -fLo ~/.vim/autoload/plug.vim --create-dirs
\ https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
autocmd VimEnter * PlugInstall --sync | source $MYVIMRC
endif
call plug#begin('~/.vim/bundle')
Plug 'morhetz/gruvbox'
Plug 'powerman/vim-plugin-AnsiEsc', { 'on': 'AnsiEsc'}
Plug 'tpope/vim-sleuth' " run `verbose Sleuth` to force vim to detect indent manually
Plug 'airblade/vim-gitgutter'
call plug#end() "}}
" netrw {{
let g:netrw_banner = 0 " no header
let g:netrw_liststyle = 3 " tree view
let g:netrw_browse_split = 4 " open file in new tab
let g:netrw_altv = 1 " vertical split
let g:netrw_winsize = 25 " 25% of window length
"}}
" gruvbox color theme settings {{
let g:gruvbox_italic=1
let g:gruvbox_transparent_bg=1
let g:gruvbox_improved_strings=1
let g:gruvbox_improved_warnings=1
let g:gruvbox_contrast_dark='hard'
let g:gruvbox_invert_indent_guides=1
let g:gruvbox_italicize_strings=1 "}}
autocmd VimEnter * hi Normal ctermbg=none " to enable transparent background color for gruvbox
colorscheme gruvbox
" vim:foldmethod=marker:foldmarker={{,}}:foldlevel=0:foldtext=substitute(getline(v\:foldstart),'\\"\\\ \\\|{{','','g')