forked from devdrops/my-dotfiles
-
Notifications
You must be signed in to change notification settings - Fork 0
/
vimrc
162 lines (147 loc) · 8.42 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
151
152
153
154
155
156
157
158
159
160
161
162
" ##################################
" # VIM SETTINGS
" #
" # REFERENCES:
" # https://github.com/mhinz/vim-galore/blob/master/static/minimal-vimrc.vim
" # http://ivanbrennan.nyc/blog/2014/01/16/rigging-vims-netrw/
" # http://www.drchip.org/astronaut/vim/index.html#NETRW
" # https://www.cs.clemson.edu/course/cpsc102/links/vimrc
" # http://ellengummesson.com/blog/2014/02/22/make-vim-really-behave-like-netrw/
" # https://gist.github.com/danidiaz/37a69305e2ed3319bfff9631175c5d0f
" # https://github.com/sickill/vim-monokai
" # https://jovicailic.org/mastering-vim-quickly/
" # https://medium.com/vim-drops/javascript-folding-on-vim-119c70d2e872
" # https://vimways.org/2018/from-vimrc-to-vim/
" # https://github.com/amix/vimrc/blob/master/vimrcs/basic.vim
" # https://html.developreference.com/article/22757209/Forcing+vimdiff+to+wrap+lines%3F
" # https://remram44.github.io/regex-cheatsheet/regex.html
" # https://cheatography.com/fievel/cheat-sheets/vim-regexp/
" # http://www.softpanorama.org/Editors/Vimorama/vim_regular_expressions.shtml
" #
" ##################################
" :::::::::: Vim General Settings ::::::::::
syntax enable " File syntax.
set nocompatible " Vim exclusive.
set autoindent " Vim auto indentation.
set ttyfast " Indicates a fast terminal connection.
set tabstop=2 " Tabs with 2 intervals.
set expandtab " Tabs replaced by spaces.
set shiftwidth=2 " Indentation with 2 intervals.
set softtabstop=2 " Indentation with 2 intervals.
set shiftround " Round indent to shiftwidth value.
set laststatus=2 " Last window status.
set display=lastline " Display the whole line instead of wrap
" with @.
set showmode " Already defined on Vim. Display current
" mode.
set incsearch " Highlight pattern on search while typing.
set hlsearch " Highlight all matches on search.
set wrapscan " Searches wrap around the end of the file.
set splitbelow " Puts the new splitted window below the
" current one.
set splitright " Puts the new splitted window right the
" current one.
set cursorline " Highlight the screen line of the cursor.
set report=0 " Reports number of lines changed. 0 stands
" for always.
set synmaxcol=200 " Maximum column to search for syntax items.
set number " Line number.
set relativenumber " Relative line number.
set wildmode=longest,list,full " Navigation method.
set wildmenu " Navigation through files/folders.
set wildignorecase " Case insensitive autocompletion for files
" and folders.
set tabpagemax=100 " Number of tabs when using `vim -p`
" (default is 10).
set showtabline=2 " Tab display. 0: never; 1: only with 2 or
" more tabs; 2: always.
set foldmethod=syntax " Defines folding method. `syntax` is based
" on file syntax.
set foldcolumn=1 " Columns when folding.
set foldlevelstart=99 " Folding mode when opening files. 99 keeps
" all folds open.
set keywordprg=google " Execute `google` when hit K. Requires
" `bins/google` file from this repository.
set autoread " Vim will automatically read all changes
" made outside Vim.
set ruler " Display current line and column numbers,
" as `live, column`.
set title " Enables title
" Modify title format
set titlestring=%t%(\ %M%)%(\ (%{expand(\"%:~:.:h\")})%)%(\ %a%)
filetype plugin on
filetype indent on
set nobackup " No backup files.
set nowritebackup " No backup write files.
set nowb " Don't write backup files.
set noswapfile " No swap files.
set noundofile " Deactivate file backup.
if $COLORTERM == 'gnome-terminal'
set t_Co=256
endif
colorscheme base16-oceanicnext " Define the current color theme. Requires
" contents from `.vim/colors` dir from this
" repository.
" :::::::::: Netrw Settings ::::::::::
let g:netrw_banner=0 " Netrw banner.
" 0 - Suppress.
" 1 - Display (default).
let g:netrw_liststyle=3 " Folder/file list style.
" 0 - Thin.
" 1 - Long.
" 2 - Wide.
" 3 - Tree.
let g:netrw_altv=1 " Control right/left splitting.
" 0 - Horizontal.
" 1 - Vertical.
let g:netrw_preview=1 " Control horizontal vs vertical splitting.
" 0 - Preview horizontal.
" 1 - Preview vertical.
let g:netrw_winsize=80 " Open the preview with 80% of the screen.
let g:netrw_special_syntax=1 " Special syntax for a given list of file
" types.
" 0 - Disabled.
" 1 - Enabled.
let g:netrw_fastbrowse=2 " Directory browsing.
" 0 - Slow.
" 1 - Medium (default).
" 2 - Fast.
" Do not display files and folders in the list.
let g:netrw_list_hide='^.git/$,.jpg$,.jpeg$,.png$,.svg,.ico,.gif$'
let g:netrw_ignorenetrc=1 " .netrc file usage.
" 0 - Load.
" 1 - Ignore.
let g:netrw_browse_split=3 " Set how to display splitted files:
" 0 - Default.
" 1 - Horizontal split.
" 2 - Vertical split.
" 3 - New tab/window.
let g:netrw_hide=1 " File display mode:
" 0 - Show all.
" 1 - Show not hidden (default).
" 2 - Show only hidden.
let g:netrw_sort_by='name' " Display sort:
" 'name' - Alphabetically (default).
" 'time' - Modification time.
" 'size' - Size.
" 'exten' - Extension.
let g:netrw_sort_direction='normal' " Sort orientation:
" 'normal' - A to Z (default).
" 'reverse' - Z to A.
let g:netrw_sort_options='i' " Sort options.
" 'i' means 'case insensitive'.
" Time format for strftime().
let g:netrw_timefmt=' %a %Y-%m-%d %I-%M-%S %p'
let g:netrw_use_noswf=0 " Netrw creation of swap files for browser
" buffers:
" 1 -Enabled (default).
" 0 - Disabled.
" :::::::::: vimdiff Settings ::::::::::
" Set line wrap when using vimdiff.
au VimEnter * if &diff | execute 'windo set wrap' | endif
" vimdiff syntax highlight
hi DiffAdd ctermfg=NONE ctermbg=DarkGreen " Added line.
hi DiffChange ctermfg=NONE ctermbg=DarkYellow " Changed line.
hi DiffDelete ctermfg=NONE ctermbg=DarkRed " Deleted line.
hi DiffText ctermfg=NONE ctermbg=DarkBlue " Changed text within a changed
" line.