-
Notifications
You must be signed in to change notification settings - Fork 0
/
init.vim
186 lines (151 loc) · 5.33 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
179
180
181
182
183
184
185
186
" >> load plugins
call plug#begin(stdpath('data') . 'vimplug')
"lsp
Plug 'nvim-lua/plenary.nvim'
Plug 'williamboman/mason.nvim'
Plug 'williamboman/mason-lspconfig.nvim'
Plug 'neovim/nvim-lspconfig'
Plug 'kyazdani42/nvim-tree.lua'
Plug 'nvim-telescope/telescope.nvim'
Plug 'ahmedkhalf/project.nvim'
Plug 'nvim-java/nvim-java'
Plug 'nvim-java/lua-async-await',
Plug 'nvim-java/nvim-java-core',
Plug 'nvim-java/nvim-java-test',
Plug 'nvim-java/nvim-java-dap',
Plug 'MunifTanjim/nui.nvim',
" completition
Plug 'hrsh7th/cmp-nvim-lsp'
Plug 'hrsh7th/nvim-cmp'
Plug 'alvan/vim-closetag'
"Debug
Plug 'mfussenegger/nvim-dap'
Plug 'rcarriga/nvim-dap-ui'
Plug 'rcarriga/cmp-dap'
"snippets
Plug 'L3MON4D3/LuaSnip', {'branch' : 'master'}
Plug 'rafamadriz/friendly-snippets'
" visuals
Plug 'nvim-treesitter/nvim-treesitter', {'do': ':TSUpdate'}
Plug 'nvim-lualine/lualine.nvim'
Plug 'kyazdani42/nvim-web-devicons' " needed for galaxyline icons
Plug 'akinsho/toggleterm.nvim', {'tag' : '*'}
" Plug 'lewis6991/hover.nvim'
Plug 'RRethy/vim-illuminate'
"Plug 'lukas-reineke/indent-blankline.nvim'
Plug 'nvimdev/lspsaga.nvim'
" themes
Plug 'srcery-colors/srcery-vim'
Plug 'luisiacc/gruvbox-baby', {'branch': 'main'}
Plug 'sonph/onehalf', { 'rtp': 'vim'}
"functionality
Plug 'sindrets/diffview.nvim'
Plug 'ThePrimeagen/harpoon'
Plug 'windwp/nvim-autopairs'
Plug 'tpope/vim-fugitive'
Plug 'numToStr/Comment.nvim'
call plug#end()
" config, and load theme
let g:srcery_inverse = 0
colorscheme gruvbox-baby
" make background transparent
"hi Normal guibg=NONE ctermbg=NONE
" colors for nvim-cmp
" gray
highlight! CmpItemAbbrDeprecated guibg=NONE gui=strikethrough guifg=#808080
" blue
highlight! mpItemAbbrMatch guibg=NONE guifg=#569CD6
highlight! CmpItemAbbrMatchFuzzy guibg=NONE guifg=#569CD6
" light blue
highlight! CmpItemKindVariable guibg=NONE guifg=#9CDCFE
highlight! CmpItemKindInterface guibg=NONE guifg=#9CDCFE
highlight! CmpItemKindText guibg=NONE guifg=#9CDCFE
" pink
highlight! CmpItemKindFunction guibg=NONE guifg=#C586C0
highlight! CmpItemKindMethod guibg=NONE guifg=#C586C0
" front
highlight! CmpItemKindKeyword guibg=NONE guifg=#D4D4D4
highlight! CmpItemKindProperty guibg=NONE guifg=#D4D4D4
highlight! CmpItemKindUnit guibg=NONE guifg=#D4D4D4
" basic settings
syntax on
set termguicolors
set number
set relativenumber
set ignorecase " ignore case
set smartcase " but don't ignore it, when search string contains uppercase letters
set nocompatible
set incsearch " do incremental searching
set visualbell
set expandtab
set tabstop=4
set ruler
set smartindent
set shiftwidth=4
set hlsearch
set cursorline
set virtualedit=all
set backspace=indent,eol,start " allow backspacing over everything in insert mode
set autoindent
set mouse=a " mouse support
set udir=~/.config/nvim/undodir udf
set nohlsearch
set wrap!
let g:netrw_banner=0
" set leader key to ,
let g:mapleader=" "
" >> illuminate binds
nnoremap <silent><C-n> :lua require('illuminate').goto_next_reference()<CR>
nnoremap <silent><C-p> :lua require('illuminate').goto_prev_reference()<CR>
" >> Harpoon bindings
nnoremap <silent><C-h> :lua require("harpoon.ui").nav_file(1)<CR>
nnoremap <silent><C-g> :lua require("harpoon.ui").nav_file(2)<CR>
nnoremap <silent><C-t> :lua require("harpoon.ui").nav_file(3)<CR>
nnoremap <silent><C-s> :lua require("harpoon.ui").nav_file(4)<CR>
nnoremap <silent><leader>a :lua require("harpoon.mark").add_file()<CR>
nnoremap <silent><C-e> :lua require("harpoon.ui").toggle_quick_menu()<CR>
" nvim-tree bindings
nnoremap <Leader>t :NvimTreeToggle<CR>
" >> Telescope bindings
nnoremap <Leader>pp <cmd>lua require'telescope.builtin'.builtin{}<CR>
" most recently used files
nnoremap <Leader>r <cmd>lua require'telescope.builtin'.oldfiles{}<CR>
" find buffer
nnoremap <Leader>bb <cmd>lua require'telescope.builtin'.buffers{}<CR>
" find in current buffer
nnoremap <Leader>/ <cmd>lua require'telescope.builtin'.current_buffer_fuzzy_find{}<CR>
" bookmarks
nnoremap <Leader>' <cmd>lua require'telescope.builtin'.marks{}<CR>
" git files
nnoremap <Leader>f <cmd>lua require'telescope.builtin'.git_files{}<CR>
" all files
nnoremap <Leader>F <cmd>lua require'telescope.builtin'.find_files{}<CR>
" ripgrep
nnoremap <Leader>rg <cmd>lua require'telescope.builtin'.live_grep{}<CR>
" pick color scheme
nnoremap <Leader>CS <cmd>lua require'telescope.builtin'.colorscheme{}<CR>
" telescope projects
nnoremap <Leader>pj <cmd>Telescope projects<CR>
" >> Normal Key bindings
nnoremap <Leader>s <Esc>:w<CR>
nnoremap <leader>n <C-^>
command Execsh set splitright | vnew | set filetype=sh | :silent r !sh #
nnoremap <silent> <Leader>rs <cmd>Execsh<CR>
nnoremap <silent> <leader>bd <cmd>bw!<CR>
" >> Lsp key bindings
nnoremap <silent> gd <cmd>lua vim.lsp.buf.definition()<CR>
nnoremap <silent> gD <cmd>lua vim.lsp.buf.declaration()<CR>
nnoremap <silent> gr <cmd>lua vim.lsp.buf.references()<CR>
nnoremap <silent> gi <cmd>lua vim.lsp.buf.implementation()<CR>
nnoremap <silent> <C-k> <cmd>lua vim.lsp.buf.signature_help()<CR>
nnoremap <silent> <Leader>c <cmd>lua vim.lsp.buf.format()<CR>
lua <<EOF
require("lsp")
require("completion")
require("statusline")
require('pairs')
require("treesitter")
require("diffview")
require("utils")
require("term")
EOF