-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinit.vim
More file actions
151 lines (129 loc) · 4.41 KB
/
init.vim
File metadata and controls
151 lines (129 loc) · 4.41 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
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
" ** Settings **
set runtimepath^=~/.vim runtimepath+=~/.vim/after
let &packpath = &runtimepath
source ~/.vimrc
set ff=unix
set statusline=%f
" set foldmethod=indent
autocmd StdinReadPre * let s:std_in=1
autocmd VimEnter * if argc() == 0 && !exists("s:std_in") | NERDTree | endif
let g:javascript_plugin_jsdoc = 1
let NERDTreeShowHidden=1
" Don't show `node_modules` & `.git` folders
let g:NERDTreeIgnore = ['^node_modules$', '^.git$']
let g:rainbow_active = 1
" Default values for conflict marker
let g:conflict_marker_begin = '^<<<<<<< \@='
let g:conflict_marker_common_ancestors = '^||||||| .*$'
let g:conflict_marker_separator = '^=======$'
let g:conflict_marker_end = '^>>>>>>> \@='
" Indenting in ts files
let g:typescript_indent_disable = 1
let g:coc_global_extensions = ['coc-tsserver']
" Disable ALE hover
let g:ale_hover_to_floating_preview = 0
let g:ale_set_balloons = 0
" Floaterm default width/height
let g:floaterm_height = 0.95
let g:floaterm_width = 0.8
" let g:neoformat_enabled_php = ['php-cs-fixer']
" ignored file for far.vim plugin
set wildignore+=*/vendor/*
set wildignore+=*/storage/*
let g:far#ignore_files = ["vendor/*", "storage/*", ".git/*"]
" Shows git branch in statusline
let g:lightline = {
\ 'active': {
\ 'left': [ [ 'mode', 'paste' ],
\ [ 'gitbranch', 'readonly', 'filename', 'modified' ] ]
\ },
\ 'component_function': {
\ 'gitbranch': 'gitbranch#name'
\ },
\ }
set encoding=utf8
set guifont=JetBrainsMono\ Nerd\ Font\ 11
" Open the terminal in `insert mode`
au BufEnter * if &buftype == 'terminal' | :startinsert | endif
" automatically run `import cost` plugin on buffer updates
augroup import_cost_auto_run
autocmd!
autocmd InsertLeave *.js,*.jsx,*.ts,*.tsx ImportCost
autocmd BufEnter *.js,*.jsx,*.ts,*.tsx ImportCost
autocmd CursorHold *.js,*.jsx,*.ts,*.tsx ImportCost
augroup END
" format on save
augroup neo_format
autocmd!
autocmd BufWritePre * undojoin | Neoformat
augroup END
" Enable use of mouse in all modes with a supported terminal"
set mouse=a
" Highlight the line that the cursor is on
set cursorline
" Start vertically scrolling when 3 lines from the top or bottom
set scrolloff=8
" Start horizontally scrolling when 3 lines from the edges
set sidescrolloff=8
" ** Plugins **
call plug#begin('~/nvim/plugged')
Plug 'ryanoasis/vim-devicons'
Plug 'preservim/nerdtree'
Plug 'neoclide/coc.nvim', {'branch': 'release'}
Plug 'sbdchd/neoformat'
Plug 'frazrepo/vim-rainbow'
Plug 'vim-scripts/vim-auto-save'
Plug 'itchyny/lightline.vim'
Plug 'dense-analysis/ale'
Plug 'rhysd/conflict-marker.vim'
Plug 'maxmellon/vim-jsx-pretty'
Plug 'dracula/vim'
Plug 'voldikss/vim-floaterm'
Plug 'mg979/vim-visual-multi', {'branch': 'master'}
Plug 'APZelos/blamer.nvim'
Plug 'yardnsm/vim-import-cost', { 'do': 'yarn install' }
Plug 'tpope/vim-commentary'
Plug 'nvim-telescope/telescope.nvim', { 'tag': '0.1.8' }
Plug 'nvim-treesitter/nvim-treesitter', {'do': ':TSUpdate'}
Plug 'junegunn/fzf', { 'do': { -> fzf#install() } }
Plug 'junegunn/fzf.vim'
Plug 'itmammoth/doorboy.vim'
Plug 'itchyny/vim-gitbranch'
call plug#end()
" ** Keys Mapping **
" `Taking note in floaterm` mapping
nnoremap <silent> <F7> :FloatermNew<CR>
nnoremap nte :FloatermNew note<CR>
nnoremap ,df :ALEGoToDefinition<CR>
" Find files using Telescope command-line sugar.
nnoremap <leader>ff <cmd>Telescope find_files<cr>
nnoremap <leader>fg <cmd>Telescope live_grep<cr>
nnoremap <leader>fb <cmd>Telescope buffers<cr>
nnoremap <leader>fh <cmd>Telescope help_tags<cr>
" CoC GoTo code navigation
nmap <silent> gd <Plug>(coc-definition)
nmap <silent> gy <Plug>(coc-type-definition)
nmap <silent> gi <Plug>(coc-implementation)
nmap <silent> gr <Plug>(coc-references)
" Use K to show documentation in preview window
nnoremap <silent> K :call ShowDocumentation()<CR>
" mapping for type ctrl-n instead of :norm after making your visual selection
vnoremap <C-n> :norm
" searching file content
nmap <silent> gcS :<C-u>CocList -I grep<cr>
" searching by file name
nmap <silent> gcf :<C-u>CocList files<cr>
" Ctrl + Up / Ctrl + Down to move current line up/down
nnoremap <C-Up> <Up>"add"ap<Up>
nnoremap <C-Down> "add"ap
" Disable ^ in Normal, Visual, and Operator-Pending modes
nnoremap ^ <Nop>
vnoremap ^ <Nop>
onoremap ^ <Nop>
function! ShowDocumentation()
if CocAction('hasProvider', 'hover')
call CocActionAsync('doHover')
else
call feedkeys('K', 'in')
endif
endfunction