1
0
Fork 0
mirror of https://github.com/pnx/dotfiles synced 2026-06-16 03:14:55 +02:00

update nvim config

This commit is contained in:
Henrik Hautakoski 2024-02-28 20:14:29 +01:00
parent 9523ecf1e3
commit feea9886f5
10 changed files with 113 additions and 56 deletions

View file

@ -16,28 +16,34 @@ return {
return col ~= 0 and vim.api.nvim_buf_get_lines(0, line - 1, line, true)[1]:sub(col, col):match("%s") == nil
end
local moveDown = cmp.mapping(function(fallback)
if cmp.visible() then
cmp.select_next_item()
elseif has_words_before() then
cmp.complete()
else
fallback()
end
end, { "i", "s" })
local moveUp = cmp.mapping(function(fallback)
if cmp.visible() then
cmp.select_prev_item()
else
fallback()
end
end, { "i", "s" })
cmp.setup({
preselect = false,
view = {
entries = { name = 'custom', selection_order = 'near_cursor' },
},
mapping = {
["<Tab>"] = cmp.mapping(function(fallback)
if cmp.visible() then
cmp.select_next_item()
elseif has_words_before() then
cmp.complete()
else
fallback()
end
end, { "i", "s" }),
["<S-Tab>"] = cmp.mapping(function(fallback)
if cmp.visible() then
cmp.select_prev_item()
else
fallback()
end
end, { "i", "s" }),
["<Tab>"] = moveDown,
["<Down>"] = moveDown,
["<S-Tab>"] = moveUp,
["<Up>"] = moveUp,
['<CR>'] = cmp.mapping.confirm({ select = true }),
},
formatting = {

View file

@ -0,0 +1,41 @@
return {
"navarasu/onedark.nvim",
lazy = false,
priority = 1000,
opts = {
style = 'darker',
code_style = {
comments = 'none',
keywords = 'none',
functions = 'none',
strings = 'none',
variables = 'none'
},
colors = {
fg = '#ffffff',
bg0 = '#282a33',
bg1 = '#30323b',
bg2 = '#24262f',
bg_d = "#1f2129",
red = '#cc817f',
green = '#7ccfaf',
yellow = '#ffcc99',
blue = '#8ac6f2',
cyan = '#8abeb7',
purple = '#9999cc'
},
highlights = {
["@string"] = { fg = "$purple" },
["@function"] = { fg = "$fg" },
["@keyword"] = { fg = "$yellow" },
["@variable.parameter"] = { fg = "$fg" },
["@punctuation.delimiter"] = { fg = "$fg" },
["@punctuation.bracket"] = { fg = "$fg" }
}
},
config = function(_, opts)
local c = require('onedark')
c.setup(opts)
c.load()
end
}

View file

@ -1,9 +0,0 @@
return {
"rebelot/kanagawa.nvim",
lazy = false,
priority = 1000,
config = function()
require("kanagawa").load("wave")
end
}

View file

@ -1,8 +1,10 @@
return {
"lukas-reineke/indent-blankline.nvim",
main = "ibl",
opts = {},
config = function()
require("ibl").setup()
end
opts = {
scope = {
enabled = true,
show_exact_scope = true
}
},
}

View file

@ -14,10 +14,11 @@ vim.opt.rtp:prepend(lazypath)
require("lazy").setup({
-- Highlight
{ import = "plugins.colortheme-kanagawa" },
{ import = "plugins.colorscheme" },
{ import = "plugins.indent" },
{ import = "plugins.nvim-autopairs" },
-- Filetree
{ import = "plugins.neo-tree" },

View file

@ -1,8 +0,0 @@
return {
dir = "~/code/misc/kodex.nvim",
lazy = false,
priority = 1000,
config = function()
vim.cmd(":colorscheme kodex-arctic")
end
}

View file

@ -30,7 +30,17 @@ return {
lspconfig.gopls.setup({})
-- Tailwind CSS
--require('lspconfig').tailwindcss.setup({ capabilities = capabilities })
-- Format on save.
vim.api.nvim_create_autocmd("BufWritePre", {
pattern = '*.go',
callback = function()
vim.lsp.buf.format { async = false }
end
})
-- Typescript
lspconfig.tsserver.setup({})
-- Config
-- Sign configuration

View file

@ -45,5 +45,17 @@ return {
}
},
},
filesystem = {
filtered_items = {
visible = true, -- when true, they will just be displayed differently than normal items
hide_dotfiles = true,
hide_gitignored = true,
hide_hidden = true, -- only works on Windows for hidden files/directories
hide_by_name = {
"node_modules",
"vendor",
},
},
},
}
}

View file

@ -8,7 +8,8 @@ return {
},
opts = {
-- A list of parser names
ensure_installed = {
ensure_installed = {
"bash",
"c",
"cpp",
"ninja",
@ -30,20 +31,18 @@ return {
"toml",
"xml",
"glsl",
"hlsl"
"hlsl",
"markdown"
},
-- Install parsers synchronously (only applied to `ensure_installed`)
sync_install = false,
sync_install = true,
-- Automatically install missing parsers when entering buffer
-- Recommendation: set to false if you don't have `tree-sitter` CLI installed locally
auto_install = true,
-- Automatically install missing parsers when entering buffer
-- Recommendation: set to false if you don't have `tree-sitter` CLI installed locally
auto_install = false,
---- 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 = {
highlight = {
enable = true,
-- Setting this to true will run `:h syntax` and tree-sitter at the same time.
@ -56,5 +55,8 @@ return {
indent = {
enable = true
}
}
},
config = function(_, opts)
require("nvim-treesitter.configs").setup(opts)
end,
}