-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.vimrc
More file actions
131 lines (121 loc) · 3.35 KB
/
.vimrc
File metadata and controls
131 lines (121 loc) · 3.35 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
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
" baseq's vim
" VIM BASICS
"------------------------------------------------------------
" use space as leader
let mapleader=" "
" syntax highlighting
syntax on
" allow for portable testing of this file
set nocompatible
" auto and smart indent
set ai si
" line numbers
set number
if has('mouse')
" enable mouse
set mouse=a
endif
" show last command in bottom right
set showcmd
" tab inserts spaces
set expandtab
" wrap without breaking words
set linebreak
" show matching brace
set showmatch
" tab and indent size
set tabstop=4 shiftwidth=4
" enable cursor line
set cursorline
" incremental and highlight search
set incsearch hlsearch
" logical split directions
set splitbelow splitright
" for security purposes
set nomodeline
" case insensitve searching
set ignorecase
" case sensitive searching for capital letters only
set smartcase
" show cursor position
set ruler
" display prompt to save changes when not specfied at exit
set confirm
" silence bell
set visualbell
" disable screen flash bell
set t_vb=
" replace buffers without needing to save them by deferring until vim exits
set hidden
" select menu in command mode
set wildmenu
set backspace=indent,eol,start
" preserve column position when using motions
set nostartofline
" line height of status bar
set laststatus=2
" status line format
set statusline=%F\ %y\ %m\ %r\ %h\ %w\ %{&filetype}\ [%l/%L]\ [%p%%]
" line height of command bar
set cmdheight=2
" paste as raw by default
set paste
" toggle auto-indent when pasting
set pastetoggle=<F11>
if has('filetype')
filetype indent plugin on
endif
"------------------------------------------------------------
" REMAPS
"------------------------------------------------------------
" clear search highlighting
nnoremap <C-C> :nohl<CR><C-L>
map Y y$
" move focus left split
nnoremap <C-H> <C-W>h
" move focus down split
nnoremap <C-J> <C-W>j
" move focus up split
nnoremap <C-K> <C-W>k
" move focus right split
nnoremap <C-L> <C-W>l
" create horizontal split
nnoremap <leader>" :new<CR>
" create vertical split
nnoremap <leader>% :vnew<CR>
" undo
set undofile
let s:undodir = expand('~/.vim/undo')
if !isdirectory(s:undodir)
call mkdir(s:undodir, 'p')
endif
let &undodir = s:undodir
" Toggle between relative and absolute line numbers
function! NumberToggle()
if(&rnu == 0)
set rnu
else
set nornu
endif
endfunction
nnoremap <leader>rnu :call NumberToggle()<CR>
"------------------------------------------------------------
" INSTALL MISSING PLUGINS
"------------------------------------------------------------
"if ! filereadable(system('echo -n "${XDG_CONFIG_HOME:-$HOME}/.vim/pack/vendor/start/nerdtree/LICENCE"'))
" echo "Installing plugins...\n"
" silent !git clone https://github.com/preservim/nerdtree.git ${XDG_CONFIG_HOME:-$HOME}/.vim/pack/vendor/start/nerdtree
" silent !vim -u NONE -c "helptags ~/.vim/pack/vendor/start/nerdtree/doc" -c -q
"endif
" PLUGINS CONFIGS
"------------------------------------------------------------
" nerdtree
" cursor focus on nerd tree
"nmap <leader>n :NERDTreeFocus<CR>
" toggle nerd tree
"nmap <C-t> :NERDTreeToggle<CR>
"autocmd vimenter * NERDTree | wincmd p
"autocmd bufenter * if (winnr("$") == 1 && exists("b:NERDTree") && b:NERDTree.isTabTree()) | q | endif
"autocmd bufwinenter * silent NERDTreeMirror
"let NERDTreeShowLineNumbers=1
"------------------------------------------------------------