Add Neovim config
This commit is contained in:
parent
5a2f500fca
commit
29e053af75
6 changed files with 352 additions and 103 deletions
103
.config/nvim/lua/init/plugins.lua
Normal file
103
.config/nvim/lua/init/plugins.lua
Normal file
|
|
@ -0,0 +1,103 @@
|
|||
-- Config shortcuts
|
||||
local keymap = vim.keymap
|
||||
local vr = vim.version.range
|
||||
|
||||
|
||||
------------------
|
||||
-- INSTALL PLUGINS
|
||||
------------------
|
||||
|
||||
vim.pack.add {
|
||||
-- Better code completion
|
||||
{ src = 'https://github.com/saghen/blink.cmp', version = vr '1.*' },
|
||||
|
||||
-- Better marks
|
||||
'https://github.com/chentoast/marks.nvim',
|
||||
|
||||
-- Surround selections with quotes etc.
|
||||
{ src = 'https://github.com/kylechui/nvim-surround', version = vr '4.*' },
|
||||
|
||||
-- Substitute and exchange operator
|
||||
'https://github.com/gbprod/substitute.nvim',
|
||||
|
||||
-- Highlight todo comments
|
||||
'https://github.com/folke/todo-comments.nvim',
|
||||
|
||||
-- Highlight colors (hex codes etc.)
|
||||
'https://github.com/brenoprata10/nvim-highlight-colors',
|
||||
}
|
||||
|
||||
|
||||
---------------------
|
||||
-- INITIALIZE PLUGINS
|
||||
---------------------
|
||||
|
||||
-- Better code completion
|
||||
require('blink.cmp').setup {
|
||||
keymap = {
|
||||
preset = 'super-tab',
|
||||
},
|
||||
cmdline = {
|
||||
keymap = {
|
||||
preset = 'inherit',
|
||||
['<Tab>'] = {
|
||||
'show',
|
||||
'select_and_accept',
|
||||
'fallback',
|
||||
},
|
||||
},
|
||||
completion = {
|
||||
menu = { auto_show = true },
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
|
||||
-- Better marks
|
||||
require('marks').setup {
|
||||
-- Show builtin marks in gutter: last jump position (`), last change (.),
|
||||
-- last selection in visual mode (</>).
|
||||
-- TODO: See which of those are really helpful and remove the others.
|
||||
builtin_marks = { '`', '.', '<', '>' },
|
||||
}
|
||||
|
||||
|
||||
-- Surround selections with quotes etc.
|
||||
require('nvim-surround').setup {}
|
||||
|
||||
|
||||
-- Substitute and exchange operator
|
||||
local substitute = require('substitute')
|
||||
substitute.setup {}
|
||||
|
||||
-- ... Use "s" key for substitute (by default "s" is equivalent to "cl")
|
||||
keymap.set('n', 's', substitute.operator)
|
||||
keymap.set('n', 'ss', substitute.line)
|
||||
keymap.set('n', 'S', substitute.eol)
|
||||
keymap.set('x', 's', substitute.visual)
|
||||
|
||||
-- ... Prefix with "," to use system clipboard (remap to use the substitute mappings above)
|
||||
keymap.set({'n', 'x'}, ',s', '"+s', { remap = true })
|
||||
keymap.set({'n', 'x'}, ',S', '"+S', { remap = true })
|
||||
|
||||
|
||||
-- Highlight todo comments
|
||||
require('todo-comments').setup {
|
||||
-- Disable gutter icons
|
||||
signs = false,
|
||||
|
||||
-- Customize highlighting
|
||||
highlight = {
|
||||
before = '',
|
||||
-- By default ("wide"), the surrounding space and colon are highlighted too,
|
||||
-- which makes the colon invisible
|
||||
keyword = 'bg',
|
||||
after = 'fg',
|
||||
-- Highlight keywords always, not just when followed by a colon (the default)
|
||||
pattern = '<(KEYWORDS)>',
|
||||
},
|
||||
}
|
||||
|
||||
|
||||
-- Highlight colors (hex codes etc.)
|
||||
require('nvim-highlight-colors').setup {}
|
||||
36
.config/nvim/lua/init/theme.lua
Normal file
36
.config/nvim/lua/init/theme.lua
Normal file
|
|
@ -0,0 +1,36 @@
|
|||
-- Install theme plugins
|
||||
vim.pack.add {
|
||||
{ src = 'https://github.com/rebelot/kanagawa.nvim', name = 'kanagawa' },
|
||||
-- { src = 'https://github.com/rose-pine/neovim', name = 'rose-pine' },
|
||||
-- { src = 'https://github.com/nickkadutskyi/jb.nvim', name = 'jetbrains-theme' },
|
||||
}
|
||||
|
||||
-- Initialize and customize themes
|
||||
require('kanagawa').setup {
|
||||
-- Compile colorscheme for fast startup times.
|
||||
-- Note: When changing the theme, make sure to run `:KanagawaCompile` afterwards!
|
||||
compile = true,
|
||||
|
||||
-- Dim inactive windows
|
||||
dimInactive = true,
|
||||
|
||||
-- Customize colors
|
||||
colors = {
|
||||
theme = {
|
||||
all = {
|
||||
ui = {
|
||||
-- Disable background of gutter (line numbers etc.)
|
||||
bg_gutter = 'none',
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
--require('rose-pine').setup {}
|
||||
--require('jb').setup {}
|
||||
|
||||
-- Enable theme
|
||||
vim.cmd.colorscheme('kanagawa')
|
||||
--vim.cmd.colorscheme('rose-pine')
|
||||
--vim.cmd.colorscheme('jb')
|
||||
Loading…
Add table
Add a link
Reference in a new issue