feat: mirgated to neovims internal plugin manager
This commit is contained in:
@@ -1,47 +1,54 @@
|
|||||||
-- Basic settings
|
-- Basic settings
|
||||||
vim.o.number = true -- Enable line numbers
|
vim.o.number = true -- Enable line numbers
|
||||||
vim.o.relativenumber = true -- Enable relative line numbers
|
-- vim.o.relativenumber = true -- Enable relative line numbers
|
||||||
vim.o.tabstop = 4 -- Number of spaces a tab represents
|
vim.o.tabstop = 2 -- Number of spaces a tab represents
|
||||||
vim.o.shiftwidth = 4 -- Number of spaces for each indentation
|
vim.o.shiftwidth = 2 -- Number of spaces for each indentation
|
||||||
vim.o.expandtab = true -- Convert tabs to spaces
|
vim.o.expandtab = true -- Convert tabs to spaces
|
||||||
vim.o.smartindent = true -- Automatically indent new lines
|
vim.o.smartindent = true -- Automatically indent new lines
|
||||||
vim.o.wrap = false -- Disable line wrapping
|
vim.o.wrap = false -- Disable line wrapping
|
||||||
vim.o.cursorline = true -- Highlight the current line
|
vim.o.cursorline = true -- Highlight the current line
|
||||||
vim.o.termguicolors = true -- Enable 24-bit RGB colors
|
vim.o.termguicolors = true -- Enable 24-bit RGB colors
|
||||||
vim.o.clipboard = "unnamedplus"
|
vim.o.clipboard = "unnamedplus"
|
||||||
vim.filetype.add({ extension = { svx = "markdown" } })
|
vim.filetype.add({ extension = { svx = "markdown" } })
|
||||||
|
vim.opt.listchars = { tab = "\\│\\", nbsp = "␣", trail = "·", extends = "›", precedes = "‹", leadmultispace = "│ " }
|
||||||
|
vim.opt.list = true
|
||||||
|
|
||||||
require('plugins.nvim-neo-tree')
|
require('plugins.nvim-neo-tree')
|
||||||
require('plugins.rose-pine')
|
require('plugins.rose-pine')
|
||||||
require('plugins.treesitter')
|
require('plugins.treesitter')
|
||||||
require('plugins.conform')
|
require('plugins.conform')
|
||||||
require('plugins.lsp')
|
require('plugins.lsp')
|
||||||
|
require('plugins.diffview')
|
||||||
|
require('plugins.which-key')
|
||||||
|
require('plugins.codecompanion')
|
||||||
|
|
||||||
vim.cmd('syntax enable')
|
vim.cmd('syntax enable')
|
||||||
|
|
||||||
|
|
||||||
vim.api.nvim_create_user_command(
|
vim.api.nvim_create_user_command(
|
||||||
"Inlay",
|
"Inlay",
|
||||||
function()
|
function()
|
||||||
vim.lsp.inlay_hint.enable(not vim.lsp.inlay_hint.is_enabled())
|
vim.lsp.inlay_hint.enable(not vim.lsp.inlay_hint.is_enabled())
|
||||||
end,
|
end,
|
||||||
{ desc = 'Toggles Inlay Hints' }
|
{ desc = 'Toggles Inlay Hints' }
|
||||||
)
|
)
|
||||||
vim.api.nvim_create_autocmd('LspAttach', {
|
vim.api.nvim_create_autocmd('LspAttach', {
|
||||||
callback = function(ev)
|
callback = function(ev)
|
||||||
local client = vim.lsp.get_client_by_id(ev.data.client_id)
|
local client = vim.lsp.get_client_by_id(ev.data.client_id)
|
||||||
if client and client:supports_method(vim.lsp.protocol.Methods.textDocument_completion) then
|
if client and client:supports_method(vim.lsp.protocol.Methods.textDocument_completion) then
|
||||||
vim.opt.completeopt = { 'menu', 'menuone', 'noinsert', 'fuzzy', 'popup' }
|
vim.opt.completeopt = { 'menu', 'menuone', 'noinsert', 'fuzzy', 'popup' }
|
||||||
vim.lsp.completion.enable(true, client.id, ev.buf, { autotrigger = true })
|
vim.lsp.completion.enable(true, client.id, ev.buf, { autotrigger = true })
|
||||||
vim.keymap.set('i', '<C-Space>', function()
|
vim.keymap.set('i', '<C-Space>', function()
|
||||||
vim.lsp.completion.get()
|
vim.lsp.completion.get()
|
||||||
end)
|
end)
|
||||||
end
|
end
|
||||||
end,
|
end,
|
||||||
})
|
})
|
||||||
|
|
||||||
vim.diagnostic.config({
|
vim.diagnostic.config({
|
||||||
virtual_lines = {
|
virtual_lines = {
|
||||||
current_line = true,
|
current_line = true,
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
|
||||||
|
vim.cmd.source("~/.config/nvim/.vimrc")
|
||||||
|
|||||||
14
.config/nvim/lua/plugins/codecompanion.lua
Normal file
14
.config/nvim/lua/plugins/codecompanion.lua
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
vim.pack.add({ {
|
||||||
|
src = "https://www.github.com/olimorris/codecompanion.nvim",
|
||||||
|
version = vim.version.range("^19.0.0")
|
||||||
|
} })
|
||||||
|
|
||||||
|
-- Somewhere in your config
|
||||||
|
require("codecompanion").setup({
|
||||||
|
interactions = {
|
||||||
|
chat = {
|
||||||
|
adapter = "ollama",
|
||||||
|
model = "qwen2.5-coder:7b "
|
||||||
|
},
|
||||||
|
},
|
||||||
|
})
|
||||||
@@ -1,24 +1,26 @@
|
|||||||
vim.pack.add({
|
vim.pack.add({
|
||||||
'https://github.com/stevearc/conform.nvim'
|
'https://github.com/stevearc/conform.nvim'
|
||||||
})
|
})
|
||||||
|
|
||||||
require('conform').setup({
|
require('conform').setup({
|
||||||
formatters_by_ft = {
|
formatters_by_ft = {
|
||||||
cpp = { "clang-format" },
|
cpp = { "clang-format" },
|
||||||
python = { "black" }
|
python = { "black" },
|
||||||
},
|
typescript = { "prettier" },
|
||||||
-- Set default options
|
typescriptreact = { "prettier" },
|
||||||
default_format_opts = {
|
},
|
||||||
lsp_format = "fallback",
|
-- Set default options
|
||||||
},
|
default_format_opts = {
|
||||||
-- Set up format-on-save
|
lsp_format = "fallback",
|
||||||
format_on_save = { timeout_ms = 1000 },
|
},
|
||||||
-- Customize formatters
|
-- Set up format-on-save
|
||||||
formatters = {
|
format_on_save = { timeout_ms = 10000 },
|
||||||
['clang-format'] = {
|
-- Customize formatters
|
||||||
append_args = function(self, ctx)
|
formatters = {
|
||||||
return { "-style={IndentWidth: 4}" }
|
-- ['clang-format'] = {
|
||||||
end,
|
-- append_args = function(self, ctx)
|
||||||
},
|
-- return { "-style={IndentWidth: 4}" }
|
||||||
},
|
-- end,
|
||||||
|
-- },
|
||||||
|
},
|
||||||
})
|
})
|
||||||
|
|||||||
6
.config/nvim/lua/plugins/diffview.lua
Normal file
6
.config/nvim/lua/plugins/diffview.lua
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
vim.pack.add({
|
||||||
|
'https://github.com/sindrets/diffview.nvim',
|
||||||
|
})
|
||||||
|
|
||||||
|
require('diffview').setup({
|
||||||
|
})
|
||||||
@@ -1,25 +1,29 @@
|
|||||||
vim.pack.add({
|
vim.pack.add({
|
||||||
'https://github.com/neovim/nvim-lspconfig',
|
'https://github.com/neovim/nvim-lspconfig',
|
||||||
'https://github.com/mason-org/mason.nvim',
|
'https://github.com/mason-org/mason.nvim',
|
||||||
'https://github.com/mason-org/mason-lspconfig.nvim',
|
'https://github.com/mason-org/mason-lspconfig.nvim',
|
||||||
})
|
})
|
||||||
|
|
||||||
require('mason').setup({
|
require('mason').setup({
|
||||||
ui = {
|
ui = {
|
||||||
icons = {
|
icons = {
|
||||||
package_installed = "✓",
|
package_installed = "✓",
|
||||||
package_pending = "➜",
|
package_pending = "➜",
|
||||||
package_uninstalled = "✗"
|
package_uninstalled = "✗"
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
}
|
||||||
})
|
})
|
||||||
require('mason-lspconfig').setup({
|
require('mason-lspconfig').setup({
|
||||||
ensure_installed = {
|
ensure_installed = {
|
||||||
"svelte",
|
"svelte",
|
||||||
"clangd",
|
"clangd",
|
||||||
"ts_ls",
|
"ts_ls",
|
||||||
"pyright",
|
"pyright",
|
||||||
"lua_ls"
|
"lua_ls"
|
||||||
},
|
},
|
||||||
automatic_enable = true,
|
automatic_enable = true,
|
||||||
|
})
|
||||||
|
vim.lsp.config('svelte', {
|
||||||
|
-- capabilities = svelte_lsp_capabilities,
|
||||||
|
filetypes = { "svelte" },
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -1,11 +1,18 @@
|
|||||||
vim.pack.add({
|
vim.pack.add({
|
||||||
'https://github.com/nvim-treesitter/nvim-treesitter'
|
'https://github.com/nvim-treesitter/nvim-treesitter'
|
||||||
})
|
})
|
||||||
|
|
||||||
require('nvim-treesitter').setup({})
|
require('nvim-treesitter').setup({
|
||||||
require('nvim-treesitter').install( {'lua','rust', 'javascript', 'zig', "c","typescript", "cpp","haskell","svelte","python", "vim", "vimdoc", "html" })
|
highlight = {
|
||||||
|
enable = true
|
||||||
|
},
|
||||||
|
})
|
||||||
|
require('nvim-treesitter').install({ 'lua', 'rust', 'javascript', 'zig', "c", "typescript", "cpp", "haskell", "svelte",
|
||||||
|
"python", "vim", "vimdoc", "html", "wgsl" })
|
||||||
|
|
||||||
vim.api.nvim_create_autocmd('FileType', {
|
vim.api.nvim_create_autocmd('FileType', {
|
||||||
pattern = { 'python', 'lua' },
|
callback = function(args)
|
||||||
callback = function() vim.treesitter.start() end,
|
pcall(vim.treesitter.start, args.buf)
|
||||||
|
end,
|
||||||
})
|
})
|
||||||
|
vim.filetype.add({ extension = { wgsl = "wgsl" } })
|
||||||
|
|||||||
7
.config/nvim/lua/plugins/which-key.lua
Normal file
7
.config/nvim/lua/plugins/which-key.lua
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
vim.pack.add({
|
||||||
|
'https://github.com/folke/which-key.nvim',
|
||||||
|
})
|
||||||
|
|
||||||
|
require("which-key").setup({
|
||||||
|
|
||||||
|
})
|
||||||
Reference in New Issue
Block a user