-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinit.vim
More file actions
156 lines (126 loc) · 3.95 KB
/
init.vim
File metadata and controls
156 lines (126 loc) · 3.95 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
152
153
154
155
156
" Disable Netrw
let g:loaded_netrw = 1
let g:loaded_netrwPlugin = 1
" Disable SWAP files
set updatecount=0
call plug#begin()
Plug 'nvim-tree/nvim-web-devicons' " OPTIONAL: for file icons
Plug 'romgrk/barbar.nvim'
Plug 'airblade/vim-rooter'
" Neotree
Plug 'nvim-neo-tree/neo-tree.nvim'
Plug 'nvim-tree/nvim-web-devicons'
Plug 'MunifTanjim/nui.nvim'
Plug 's1n7ax/nvim-window-picker'
" Stuff for Elixir LSP
Plug 'neovim/nvim-lspconfig'
" Autocompletion acording to https://github.com/neovim/nvim-lspconfig/wiki/Autocompletion
Plug 'hrsh7th/nvim-cmp' " Autocompletion plugin
Plug 'hrsh7th/cmp-nvim-lsp' " LSP source for nvim-cmp
Plug 'saadparwaiz1/cmp_luasnip' " Snippets source for nvim-cmp
Plug 'L3MON4D3/LuaSnip' " Snippets plugin
Plug 'onsails/lspkind-nvim'
Plug 'ryanoasis/vim-devicons'
" Git integration
Plug 'tpope/vim-fugitive'
Plug 'lewis6991/gitsigns.nvim'
" Telescope
Plug 'nvim-lua/plenary.nvim'
Plug 'nvim-telescope/telescope.nvim', { 'tag': '0.1.5' }
Plug 'BurntSushi/ripgrep'
Plug 'sharkdp/fd' " (finder)
Plug 'nvim-treesitter/nvim-treesitter' " (finder/preview)
Plug 'nvim-tree/nvim-web-devicons' " (icons)
" colorschemes
Plug 'folke/tokyonight.nvim'
Plug 'catppuccin/nvim'
" Opening files in quickfix window
Plug 'yssl/QFEnter'
call plug#end()
PlugInstall | quit
if exists("g:neovide")
colorscheme catppuccin-mocha
endif
" " normal mode
" nmap <C-l> :bn <CR>
" nmap <C-h> :bp <CR>
" nmap <C-m> :bd <CR>
nmap <C-j> 5j
vmap <C-j> 5j
nmap <C-k> 5k
vmap <C-k> 5k
map <D-a> ggVG<CR>
" barbar mappings
nnoremap <silent> <C-l> <Cmd>BufferNext<CR>
nnoremap <silent> <C-h> <Cmd>BufferPrevious<CR>
nnoremap <silent> <C-m> <Cmd>BufferClose<CR>
" command mode
cnoremap <C-a> <Home>
cnoremap <C-d> <Delete>
cnoremap <C-e> <End>
cnoremap <C-p> <Up>
cnoremap <C-n> <Down>
cnoremap <C-b> <Left>
cnoremap <C-f> <Right>
" CMD-v for paste in normal mode
nnoremap <D-v> p
" CMD-v for paste in visual mode
vnoremap <D-v> p
" CMD-v for paste in command mode (works with system clipboard)
cnoremap <D-v> <C-r>+
" CMD-v for paste in insert mode (works with system clipboard)
inoremap <D-v> <C-r>+
" CMD-c for copy in select mode
snoremap <D-c> "+y
vnoremap <D-c> "+y
" CMD-c for cut in select mode
snoremap <D-x> "+d
vnoremap <D-x> "+d
" use system clipboard
set clipboard+=unnamedplus
" replace tabs with spaces
set shiftwidth=2 smarttab
set expandtab
set tabstop=8 softtabstop=0
" make C-e open :e current-dir
nmap <expr> <C-e> Elocal()
function! Elocal ()
let dir = getcwd()
return ":e " . expand('%:p:h') . "/"
endfunction
" Neotree and NERDTree
:so $HOME/.config/nvim/config/tree_config.vim
nmap <Esc><Esc> :Neotree reveal <CR>
" When opening a file from quickfix findow, switch the window first
autocmd FileType qf nnoremap <buffer> <Enter> <C-^><Enter>
" start in workspace dir
cd $HOME/workspace
" enable line nubmers
set number
" disable coursor animation
let g:neovide_cursor_animation_length = 0
" color coursor, selection and overlength content
highlight ColorColumn ctermbg=magenta guibg=IndianRed3
set colorcolumn=120
highlight cursor guifg=yellow guibg=red
highlight iCursor guifg=red guibg=white
highlight visual guifg=red guibg=yellow
" configure Language Server
:so $HOME/.config/nvim/config/lsp_config.vim
" configure Telescope shortcuts
:so $HOME/.config/nvim/config/telescope_config.vim
nnoremap <D-t> <cmd>Telescope find_files<cr>
nnoremap <leader>ff <cmd>Telescope find_files<cr>
nnoremap <D-g> <cmd>Telescope live_grep<cr>
nnoremap <leader>fg <cmd>Telescope live_grep<cr>
nnoremap <leader>fb <cmd>Telescope buffers<cr>
nnoremap <leader>fh <cmd>Telescope help_tags<cr>
" Disable CMD-q (doesn't appear to work, need to disable CMD-q in system
" keyboard shortcuts)
let g:neovide_confirm_quit = v:true
noremap <D-q> <nop>
" Configure vim-rooter to only look at the Git directory (fixes the issue with
" umbrella apps)
let g:rooter_patterns = ['.git']
" configure GitSigns
:so $HOME/.config/nvim/config/git_config.vim