-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinit.vim
178 lines (130 loc) · 4.44 KB
/
init.vim
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
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
set nocompatible "Latest vim settings/options
so $HOME/.config/nvim/vundle.vim
syntax enable
set backspace=indent,eol,start "Make backspace behave like every other editor
let mapleader=',' "set <Leader>
"------------Visuals------------"
" Set popup menu color
highlight Pmenu ctermbg=gray guibg=gray
" TUI true colors
if (has("termguicolors"))
set termguicolors
endif
let g:oceanic_next_terminal_bold=1
let g:oceanic_next_terminal_italic=1
colorscheme OceanicNext "set the theme for vim
set guifont=SauceCodePro\ Nerd\ Font\ Mono\ 14
set guioptions-=e "Disable tabs
set linespace=1 "gVim-specific line-height
set number "Enable line numbers
"Disable scrollbars in gVim
set guioptions-=l
set guioptions-=L
set guioptions-=r
set guioptions-=R
set guioptions-=m "disable menubar
set guioptions-=T "disable toolbar
hi Normal guibg=NONE ctermbg=NONE
"------------File Management-----------"
nmap - :RangerCurrentDirectory<cr>
nmap <Leader>- :Ranger<cr>
let g:ranger_replace_netrw = 1
"------------Terminal------------"
" highlight TermCursor ctermfg=red guifg=red
nmap <Leader>= :12Term<cr>
augroup autotermconf
autocmd!
autocmd BufEnter * if &buftype == 'terminal' | :startinsert | endif
autocmd BufEnter * silent! lcd %:p:h
augroup END
"------------Searching------------"
set hlsearch "highlight search results
set incsearch "highlight search results as they're typed
"------------Split Management------------"
set splitbelow "Make horizontal splits open below by default
set splitright "Make vertical splits open to the right by defualt
" reselect visual block after shifting indentation
vnoremap < <gv
vnoremap > >gv
nmap <C-Down> <C-W><C-J>
nmap <C-Up> <C-W><C-K>
nmap <C-Left> <C-W><C-H>
nmap <C-Right> <C-W><C-L>
"------------Editor------------"
set tabstop=4 "size of hard tabstop
set shiftwidth=4 "size of indent
set softtabstop=4 "use both spaces and tabs to simulate tabstops at a width
set smarttab "indent new lines
set expandtab "replace spaces with space
set complete=.,w,b,u "set auto completion
"------------Swap/Backup Files------------"
set backup "enable backup files
set backupdir=/tmp "set backup file directory
set dir=/tmp "set swap file location
let g:netrw_dirhistmax = 0 "stop log messages from netrw
"------------Mappings------------"
"set hidden
nnoremap <C-N> :bnext<CR>
nnoremap <C-P> :bprev<CR>
nmap <C-A-Up> <C-W>+
nmap <C-A-Down> <C-W>-
"Retab file
nmap <Leader>rt gg=G
"Insert timestamp
nmap <Leader>ts :put = strftime('%Y-%m-%d')<cr>
"Save files with sudo (root)
cmap w!! %!sudo tee > /dev/null %<cr>:e!<cr><cr>
"Enable line numbers
nmap <Leader>. :set number!<cr>
"Make it easy to edit Vimrc file.
nmap <Leader>ev :e $MYVIMRC<cr>
"clear search results
nmap <Leader><space> :nohlsearch<cr>
"toggle line indents
nmap <Leader>il :IndentLinesToggle<cr>
"generate i3 config
nmap <Leader>gc :10Term i3-gen-conf<cr>
"------------Laravel------------"
"Artisan
nmap <Leader>laa :!php artisan
nmap <Leader>lam :!php artisan make:
nmap <Leader>lar :!php artisan routes:list<cr>
"Node
nmap <Leader>ng :!gulp<cr>
"Composer
nmap <Leader>cda :!composer dumpautoload<cr>
"Project navigation
nmap <Leader><Leader>lr :e routes/<cr>
nmap <Leader><Leader>lc :e app/Http/Controllers/<cr>
nmap <Leader><Leader>lm :e app/<cr>
"Custom style design pattern mapping
nmap <Leader><Leader>dm :e app/Models<cr>
nmap <Leader><Leader>rp :e app/Repositories<cr>
"/
"/ pdv
"/
let g:pdv_template_dir = "$HOME/.config/nvim/dein/repos/github.com/tobyS/pdv/templates_snip"
nnoremap <leader>d :call pdv#DocumentWithSnip()<CR>
"------------Auto Commands------------"
augroup autosourcing
autocmd!
autocmd BufWritePost $HOME/.config/nvim/init.vim source % "Automatically source the Vimrc file on save
augroup END
"------------Powerline-----------"
"Always show statusline
set laststatus=2
let g:airline_powerline_fonts = 1
let g:airline_theme = 'oceanicnext'
"------------vim-javascript-----------"
let g:javascript_plugin_jsdoc = 1
"------------vim-arduino-----------"
" my_file.ino [arduino:avr:uno] [arduino:usbtinyisp] (/dev/ttyACM0:9600)
function! MyStatusLine()
let port = arduino#GetPort()
let line = '%f [' . g:arduino_board . '] [' . g:arduino_programmer . ']'
if !empty(port)
let line = line . ' (' . port . ':' . g:arduino_serial_baud . ')'
endif
return line
endfunction
setl statusline=%!MyStatusLine()