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
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
|
call plug#begin('~/.config/nvim/plugged')
Plug 'dikiaap/minimalist'
Plug 'sainnhe/sonokai'
Plug 'folke/tokyonight.nvim'
Plug 'marko-cerovac/material.nvim'
Plug 'rmehri01/onenord.nvim'
Plug 'AlexvZyl/nordic.nvim'
Plug 'RRethy/nvim-base16'
Plug 'catppuccin/nvim', { 'as': 'catppuccin' }
Plug 'preservim/nerdtree'
Plug 'https://github.com/vim-airline/vim-airline'
Plug 'vim-airline/vim-airline-themes'
" Plug 'https://github.com/neoclide/coc.nvim'
Plug 'lewis6991/gitsigns.nvim'
Plug 'nvim-tree/nvim-web-devicons'
Plug 'ryanoasis/vim-devicons'
" Plug 'romgrk/barbar.nvim'
Plug 'mattn/emmet-vim'
Plug 'RRethy/vim-illuminate'
" Plug 'folke/noice.nvim'
" Plug 'MunifTanjim/nui.nvim'
" Plug 'rcarriga/nvim-notify'
Plug 'nvim-lua/plenary.nvim'
Plug 'nvim-telescope/telescope.nvim'
Plug 'williamboman/mason.nvim'
" Plug 'fannheyward/telescope-coc.nvim'
" Treesitter, a highlighter
Plug 'nvim-treesitter/nvim-treesitter'
" LSP Installer
Plug 'neovim/nvim-lspconfig'
Plug 'williamboman/mason-lspconfig.nvim'
" Completion & Actual LSP
Plug 'hrsh7th/nvim-cmp'
Plug 'hrsh7th/cmp-buffer'
Plug 'hrsh7th/cmp-nvim-lsp'
Plug 'hrsh7th/cmp-vsnip'
Plug 'hrsh7th/cmp-cmdline'
Plug 'hrsh7th/cmp-path'
Plug 'hrsh7th/vim-vsnip'
Plug 'hrsh7th/vim-vsnip-integ'
" Debugger
Plug 'mfussenegger/nvim-dap'
Plug 'windwp/nvim-autopairs'
Plug 'vimwiki/vimwiki'
Plug '3rd/image.nvim'
call plug#end()
" lua require("noice").setup()
set encoding=UTF-8
set number
set relativenumber
set mouse=a
set clipboard=unnamedplus
" set shiftwidth=4 smarttab
set cursorline
set termguicolors
set completeopt=menu,menuone,noselect
set nocompatible
set noshowmode
" set nowrap
filetype plugin on
syntax on
colorscheme catppuccin-frappe
nnoremap <silent> <C-l> o<Esc>
" nnoremap <silent> <C-y> :NERDTree<CR>
" nnoremap <silent> <C-t> :NERDTreeToggle<CR>
nnoremap <silent> <C-q> :Telescope<CR>
nnoremap <silent> <C-f> :Telescope current_buffer_fuzzy_find<CR>
nnoremap <silent> <C-g> :Telescope find_files<CR>
nnoremap <silent> <C-h> :Telescope buffers<CR>
nnoremap <silent> <C-a> :Telescope tags<CR>
" " Move to previous/next
" nnoremap <silent> <A-Tab> <Cmd>BufferPrevious<CR>
" nnoremap <silent> <A-Tab> <Cmd>BufferNext<CR>
"
" " Re-order to previous/next
" nnoremap <silent> <A-<> <Cmd>BufferMovePrevious<CR>
" nnoremap <silent> <A->> <Cmd>BufferMoveNext<CR>
"
" " Goto buffer in position...
" nnoremap <silent> <A-1> <Cmd>BufferGoto 1<CR>
" nnoremap <silent> <A-2> <Cmd>BufferGoto 2<CR>
" nnoremap <silent> <A-3> <Cmd>BufferGoto 3<CR>
" nnoremap <silent> <A-4> <Cmd>BufferGoto 4<CR>
" nnoremap <silent> <A-5> <Cmd>BufferGoto 5<CR>
" nnoremap <silent> <A-6> <Cmd>BufferGoto 6<CR>
" nnoremap <silent> <A-7> <Cmd>BufferGoto 7<CR>
" nnoremap <silent> <A-8> <Cmd>BufferGoto 8<CR>
" nnoremap <silent> <A-9> <Cmd>BufferGoto 9<CR>
" nnoremap <silent> <A-0> <Cmd>BufferLast<CR>
"
" " Pin/unpin buffer
" nnoremap <silent> <A-p> <Cmd>BufferPin<CR>
"
" " Close buffer
" nnoremap <silent> <A-c> <Cmd>BufferClose<CR>
" " Restore buffer
" nnoremap <silent> <A-s-c> <Cmd>BufferRestore<CR>
"
" " Wipeout buffer
" " :BufferWipeout
" " Close commands
" " :BufferCloseAllButCurrent
" " :BufferCloseAllButVisible
" " :BufferCloseAllButPinned
" " :BufferCloseAllButCurrentOrPinned
" " :BufferCloseBuffersLeft
" " :BufferCloseBuffersRight
"
" " Magic buffer-picking mode
" nnoremap <silent> <C-p> <Cmd>BufferPick<CR>
" nnoremap <silent> <C-p> <Cmd>BufferPickDelete<CR>
"
" " Sort automatically by...
" nnoremap <silent> <Space>bb <Cmd>BufferOrderByBufferNumber<CR>
" nnoremap <silent> <Space>bd <Cmd>BufferOrderByDirectory<CR>
" nnoremap <silent> <Space>bl <Cmd>BufferOrderByLanguage<CR>
" nnoremap <silent> <Space>bw <Cmd>BufferOrderByWindowNumber<CR>
" Prettier
" nnoremap <A-S-p> <Cmd>Prettier<CR>
" Visual Block Mode
nnoremap <A-v> <c-v>
" Compile
nnoremap <F5> <Cmd>wa<CR><Cmd>DapContinue<CR>
if exists("g:neovide")
let g:neovide_fullscreen = 'false'
let g:neovide_remember_window_size = v:false
set guifont=JetBrainsMono\ Nerd\ Font:h12
endif
let g:vimwiki_list = [{'syntax': 'markdown', 'filetype': 'md'}]
" Emmet
let g:user_emmet_mode='n'
let g:user_emmet_leader_key=','
" Other:
" :BarbarEnable - enables barbar (enabled by default)
" :BarbarDisable - very bad command, should never be used
" Terminal & neoterm
let g:neoterm_default_mod = 'vertical'
" airline
let g:airline_theme = 'catppuccin'
let g:airline_powerline_fonts = 1
if !exists('g:airline_symbols')
let g:airline_symbols = {}
endif
let g:airline#extensions#wordcount#enabled = 1
let g:airline#extensions#wordcount#filetypes = '\vnotes|help|markdown|rst|org|text|asciidoc|tex|mail|vimwiki'
let g:airline_left_sep = ''
let g:airline_right_sep = ''
let g:airline_symbols.linenr = '␊'
let g:airline_symbols.linenr = ''
let g:airline_symbols.linenr = '¶'
let g:airline_symbols.branch = '⎇'
let g:airline_symbols.paste = 'ρ'
let g:airline_symbols.paste = 'Þ'
let g:airline_symbols.paste = '∥'
let g:airline_symbols.whitespace = 'Ξ'
let g:airline_symbols.branch = ''
let g:airline_symbols.readonly = ''
let g:airline_symbols.linenr = ''
let g:WebDevIconsUnicodeDecorateFolderNodes = 1
let g:WebDevIconsUnicodeDecorateFolderNodeDefaultSymbol = ''
let g:WebDevIconsUnicodeDecorateFileNodesExtensionSymbols = {}
let g:WebDevIconsUnicodeDecorateFileNodesExtensionSymbols['nerdtree'] = ''
let g:NERDTreeDirArrowExpandable=""
let g:NERDTreeDirArrowCollapsible=""
" inoremap <silent><expr> <Tab> coc#pum#visible() ? coc#pum#confirm() : "\<Tab>"
" inoremap <silent><expr> <S-Tab> coc#pum#visible() ? coc#pum#close() : "\<S-Tab>"
" command! -nargs=0 Prettier :CocCommand prettier.forceFormatDocument
set splitbelow
set splitright
" this is linux idiot set shell=powershell
set shellcmdflag=-command
set shellquote=\"
set shellxquote=
command! -nargs=* T split | terminal <args>
command! -nargs=* VT vsplit | terminal <args>
lua require("telescope").setup()
lua require("mason").setup()
lua require("mason-lspconfig").setup()
lua require("nvim-autopairs").setup {}
lua << EOF
local dap = require('dap')
dap.adapters.godot = {
type = "server",
host = '127.0.0.1',
port = 6006,
}
dap.configurations.gdscript = {
{
type = "godot",
request = "launch",
name = "Launch scene",
project = "${workspaceFolder}",
}
}
require("telescope").setup({
defaults = {
mappings = {
i = {
[ "<C-A-q>" ] = require("telescope.actions.layout").toggle_preview
}
}
}
})
-- Set up nvim-cmp.
local cmp = require'cmp'
local working_dir = vim.loop.cwd()
-- Global setup.
cmp.setup({
snippet = {
expand = function(args)
vim.fn["vsnip#anonymous"](args.body) -- For `vsnip` users.
-- require('luasnip').lsp_expand(args.body) -- For `luasnip` users.
-- require'snippy'.expand_snippet(args.body) -- For `snippy` users.
-- vim.fn["UltiSnips#Anon"](args.body) -- For `ultisnips` users.
end,
},
window = {
-- completion = cmp.config.window.bordered(),
-- documentation = cmp.config.window.bordered(),
},
mapping = cmp.mapping.preset.insert({
['<C-d>'] = cmp.mapping.scroll_docs(-4),
['<C-f>'] = cmp.mapping.scroll_docs(4),
['<C-Space>'] = cmp.mapping.complete(),
['<CR>'] = cmp.mapping.confirm({ select = true }),
['<Tab>'] = cmp.mapping.confirm({ select = true }),
['`'] = cmp.mapping.abort(),
}),
sources = cmp.config.sources({
{ name = 'nvim_lsp' },
{ name = 'vsnip' }, -- For vsnip users.
-- { name = 'luasnip' }, -- For luasnip users.
-- { name = 'snippy' }, -- For snippy users.
-- { name = 'ultisnips' }, -- For ultisnips users.
}, {
{ name = 'buffer' },
{
name = 'path',
option = {
get_cwd = function(working_dir)
end
}
}
})
})
-- `/` cmdline setup.
cmp.setup.cmdline('/', {
mapping = cmp.mapping.preset.cmdline(),
sources = {
{ name = 'buffer' },
{
name = 'path',
option = {
get_cwd = function(working_dir)
end
}
}
}
})
-- `:` cmdline setup.
cmp.setup.cmdline(':', {
mapping = cmp.mapping.preset.cmdline(),
sources = cmp.config.sources({
{
name = 'path',
option = {
get_cwd = function(working_dir)
end
}
}
}, {
{ name = 'cmdline' }
})
})
-- Setup lspconfig.
local capabilities = require('cmp_nvim_lsp').default_capabilities()
require("lspconfig")["tsserver"].setup{
capabilities = capabilities
}
require("lspconfig")["html"].setup{
capabilities = capabilities
}
require("lspconfig")["cssls"].setup{
capabilities = capabilities
}
require("lspconfig")["jsonls"].setup{
capabilities = capabilities
}
require("lspconfig")["clangd"].setup{
capabilities = capabilities
}
require("lspconfig")["texlab"].setup{
capabilities = capabilities
}
require("lspconfig")["ltex"].setup{
capabilities = capabilities,
settings = {
ltex = {
language = "en-GB",
dictionary = {
["en-GB"] = {'Altaf', 'altaf', 'altaf-creator', 'altaf-devlogs', 'simpliCity'},
["en-US"] = {'Altaf', 'altaf', 'altaf-creator', 'altaf-devlogs', 'simpliCity'},
["id-ID"] = {'Altaf', 'altaf', 'altaf-creator', 'altaf-devlogs', 'simpliCity'},
},
enabled = {"markdown", "vimwiki", "texlab"},
},
},
}
require("lspconfig")["rust_analyzer"].setup{
capabilities = capabilities
}
require("lspconfig").gdscript.setup{
capabilities = capabilities,
on_attach = on_attach,
flags = {
debounce_text_changes = 150,
}
}
-- Setup nvim-treesitter
require'nvim-treesitter.configs'.setup {
-- A list of parser names, or "all" (the five listed parsers should always be installed)
ensure_installed = { "c", "lua", "vim", "vimdoc", "query", "html", "javascript", "css", "cpp", "gdscript"},
-- Install parsers synchronously (only applied to `ensure_installed`)
sync_install = false,
-- Automatically install missing parsers when entering buffer
-- Recommendation: set to false if you don't have `tree-sitter` CLI installed locally
auto_install = true,
---- If you need to change the installation directory of the parsers (see -> Advanced Setup)
-- parser_install_dir = "/some/path/to/store/parsers", -- Remember to run vim.opt.runtimepath:append("/some/path/to/store/parsers")!
highlight = {
enable = true,
disable = { "html" }, -- currently, nvim-treesitter segfaults when trying to type 2 whitespaces
-- Setting this to true will run `:h syntax` and tree-sitter at the same time.
-- Set this to `true` if you depend on 'syntax' being enabled (like for indentation).
-- Using this option may slow down your editor, and you may see some duplicate highlights.
-- Instead of true it can also be a list of languages
additional_vim_regex_highlighting = true,
},
}
-- default config nvim.image
if not vim.g.neovide then
require("image").setup({
backend = "kitty",
integrations = {
markdown = {
enabled = true,
clear_in_insert_mode = false,
download_remote_images = true,
only_render_image_at_cursor = false,
filetypes = { "markdown", "vimwiki" }, -- markdown extensions (ie. quarto) can go here
},
neorg = {
enabled = true,
clear_in_insert_mode = false,
download_remote_images = true,
only_render_image_at_cursor = false,
filetypes = { "norg" },
},
html = {
enabled = false,
},
css = {
enabled = false,
},
},
max_width = nil,
max_height = nil,
max_width_window_percentage = nil,
max_height_window_percentage = 50,
window_overlap_clear_enabled = false, -- toggles images when windows are overlapped
window_overlap_clear_ft_ignore = { "cmp_menu", "cmp_docs", "" },
editor_only_render_when_focused = false, -- auto show/hide images when the editor gains/looses focus
tmux_show_only_in_active_window = false, -- auto show/hide images in the correct Tmux window (needs visual-activity off)
hijack_file_patterns = { "*.png", "*.jpg", "*.jpeg", "*.gif", "*.webp" }, -- render image files as images when opened
})
end
print("Hello, World!")
EOF
|