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

@ -6,20 +6,20 @@
"cmp-path": { "branch": "main", "commit": "91ff86cd9c29299a64f968ebb45846c485725f23" },
"gitsigns.nvim": { "branch": "main", "commit": "2c2463dbd82eddd7dbab881c3a62cfbfbe3c67ae" },
"indent-blankline.nvim": { "branch": "master", "commit": "821a7acd88587d966f7e464b0b3031dfe7f5680c" },
"kanagawa.nvim": { "branch": "master", "commit": "ab41956c4559c3eb21e713fcdf54cda1cb6d5f40" },
"lazy.nvim": { "branch": "main", "commit": "aedcd79811d491b60d0a6577a9c1701063c2a609" },
"lspkind-nvim": { "branch": "master", "commit": "1735dd5a5054c1fb7feaf8e8658dbab925f4f0cf" },
"lualine-lsp-progress": { "branch": "master", "commit": "56842d097245a08d77912edf5f2a69ba29f275d7" },
"lualine.nvim": { "branch": "master", "commit": "7d131a8d3ba5016229e8a1d08bf8782acea98852" },
"mason-lspconfig.nvim": { "branch": "main", "commit": "21d33d69a81f6351e5a5f49078b2e4f0075c8e73" },
"mason.nvim": { "branch": "main", "commit": "c43eeb5614a09dc17c03a7fb49de2e05de203924" },
"neo-tree.nvim": { "branch": "main", "commit": "7d3b02073e59ed9ef271795787de76d0de8f5294" },
"mason.nvim": { "branch": "main", "commit": "3b5068f0fc565f337d67a2d315d935f574848ee7" },
"neo-tree.nvim": { "branch": "main", "commit": "459c60317cc1d251f6eb3b6f010d015d5d24b806" },
"nui.nvim": { "branch": "main", "commit": "c3c7fd618dcb5a89e443a2e1033e7d11fdb0596b" },
"nvim-autopairs": { "branch": "master", "commit": "1efb4f2e754d282762a1413ea0528d9a45143cdd" },
"nvim-autopairs": { "branch": "master", "commit": "c6139ca0d5ad7af129ea6c89cb4c56093f2c034a" },
"nvim-cmp": { "branch": "main", "commit": "04e0ca376d6abdbfc8b52180f8ea236cbfddf782" },
"nvim-lspconfig": { "branch": "master", "commit": "b22610cc7ceb513396adb8e648abb1d1613b2a82" },
"nvim-treesitter": { "branch": "master", "commit": "c06292fdc641d71d185d2f1a507ad8232b6cf528" },
"nvim-web-devicons": { "branch": "master", "commit": "14ac5887110b06b89a96881d534230dac3ed134d" },
"nvim-lspconfig": { "branch": "master", "commit": "b1a11b042d015df5b8f7f33aa026e501b639c649" },
"nvim-treesitter": { "branch": "master", "commit": "db12bd416e2764420047e4a5d6b96fe44e4377d5" },
"nvim-web-devicons": { "branch": "master", "commit": "0bb67ef952ea3eb7b1bac9c011281471d99a27bc" },
"onedark.nvim": { "branch": "master", "commit": "1230aaf2a427b2c5b73aba6e4a9a5881d3e69429" },
"playground": { "branch": "master", "commit": "ba48c6a62a280eefb7c85725b0915e021a1a0749" },
"plenary.nvim": { "branch": "master", "commit": "4f71c0c4a196ceb656c824a70792f3df3ce6bb6d" },
"telescope.nvim": { "branch": "master", "commit": "7011eaae0ac1afe036e30c95cf80200b8dc3f21a" },

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,
}