feat: mirgated to neovims internal plugin manager
This commit is contained in:
@@ -1,47 +1,54 @@
|
||||
-- Basic settings
|
||||
vim.o.number = true -- Enable line numbers
|
||||
vim.o.relativenumber = true -- Enable relative line numbers
|
||||
vim.o.tabstop = 4 -- Number of spaces a tab represents
|
||||
vim.o.shiftwidth = 4 -- Number of spaces for each indentation
|
||||
vim.o.expandtab = true -- Convert tabs to spaces
|
||||
vim.o.smartindent = true -- Automatically indent new lines
|
||||
vim.o.wrap = false -- Disable line wrapping
|
||||
vim.o.cursorline = true -- Highlight the current line
|
||||
vim.o.termguicolors = true -- Enable 24-bit RGB colors
|
||||
vim.o.number = true -- Enable line numbers
|
||||
-- vim.o.relativenumber = true -- Enable relative line numbers
|
||||
vim.o.tabstop = 2 -- Number of spaces a tab represents
|
||||
vim.o.shiftwidth = 2 -- Number of spaces for each indentation
|
||||
vim.o.expandtab = true -- Convert tabs to spaces
|
||||
vim.o.smartindent = true -- Automatically indent new lines
|
||||
vim.o.wrap = false -- Disable line wrapping
|
||||
vim.o.cursorline = true -- Highlight the current line
|
||||
vim.o.termguicolors = true -- Enable 24-bit RGB colors
|
||||
vim.o.clipboard = "unnamedplus"
|
||||
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.rose-pine')
|
||||
require('plugins.treesitter')
|
||||
require('plugins.conform')
|
||||
require('plugins.lsp')
|
||||
require('plugins.diffview')
|
||||
require('plugins.which-key')
|
||||
require('plugins.codecompanion')
|
||||
|
||||
vim.cmd('syntax enable')
|
||||
|
||||
|
||||
vim.api.nvim_create_user_command(
|
||||
"Inlay",
|
||||
function()
|
||||
vim.lsp.inlay_hint.enable(not vim.lsp.inlay_hint.is_enabled())
|
||||
end,
|
||||
{ desc = 'Toggles Inlay Hints' }
|
||||
"Inlay",
|
||||
function()
|
||||
vim.lsp.inlay_hint.enable(not vim.lsp.inlay_hint.is_enabled())
|
||||
end,
|
||||
{ desc = 'Toggles Inlay Hints' }
|
||||
)
|
||||
vim.api.nvim_create_autocmd('LspAttach', {
|
||||
callback = function(ev)
|
||||
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
|
||||
vim.opt.completeopt = { 'menu', 'menuone', 'noinsert', 'fuzzy', 'popup' }
|
||||
vim.lsp.completion.enable(true, client.id, ev.buf, { autotrigger = true })
|
||||
vim.keymap.set('i', '<C-Space>', function()
|
||||
vim.lsp.completion.get()
|
||||
end)
|
||||
end
|
||||
end,
|
||||
callback = function(ev)
|
||||
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
|
||||
vim.opt.completeopt = { 'menu', 'menuone', 'noinsert', 'fuzzy', 'popup' }
|
||||
vim.lsp.completion.enable(true, client.id, ev.buf, { autotrigger = true })
|
||||
vim.keymap.set('i', '<C-Space>', function()
|
||||
vim.lsp.completion.get()
|
||||
end)
|
||||
end
|
||||
end,
|
||||
})
|
||||
|
||||
vim.diagnostic.config({
|
||||
virtual_lines = {
|
||||
current_line = true,
|
||||
},
|
||||
virtual_lines = {
|
||||
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({
|
||||
'https://github.com/stevearc/conform.nvim'
|
||||
'https://github.com/stevearc/conform.nvim'
|
||||
})
|
||||
|
||||
require('conform').setup({
|
||||
formatters_by_ft = {
|
||||
cpp = { "clang-format" },
|
||||
python = { "black" }
|
||||
},
|
||||
-- Set default options
|
||||
default_format_opts = {
|
||||
lsp_format = "fallback",
|
||||
},
|
||||
-- Set up format-on-save
|
||||
format_on_save = { timeout_ms = 1000 },
|
||||
-- Customize formatters
|
||||
formatters = {
|
||||
['clang-format'] = {
|
||||
append_args = function(self, ctx)
|
||||
return { "-style={IndentWidth: 4}" }
|
||||
end,
|
||||
},
|
||||
},
|
||||
formatters_by_ft = {
|
||||
cpp = { "clang-format" },
|
||||
python = { "black" },
|
||||
typescript = { "prettier" },
|
||||
typescriptreact = { "prettier" },
|
||||
},
|
||||
-- Set default options
|
||||
default_format_opts = {
|
||||
lsp_format = "fallback",
|
||||
},
|
||||
-- Set up format-on-save
|
||||
format_on_save = { timeout_ms = 10000 },
|
||||
-- Customize formatters
|
||||
formatters = {
|
||||
-- ['clang-format'] = {
|
||||
-- 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({
|
||||
'https://github.com/neovim/nvim-lspconfig',
|
||||
'https://github.com/mason-org/mason.nvim',
|
||||
'https://github.com/mason-org/mason-lspconfig.nvim',
|
||||
'https://github.com/neovim/nvim-lspconfig',
|
||||
'https://github.com/mason-org/mason.nvim',
|
||||
'https://github.com/mason-org/mason-lspconfig.nvim',
|
||||
})
|
||||
|
||||
require('mason').setup({
|
||||
ui = {
|
||||
icons = {
|
||||
package_installed = "✓",
|
||||
package_pending = "➜",
|
||||
package_uninstalled = "✗"
|
||||
}
|
||||
ui = {
|
||||
icons = {
|
||||
package_installed = "✓",
|
||||
package_pending = "➜",
|
||||
package_uninstalled = "✗"
|
||||
}
|
||||
}
|
||||
})
|
||||
require('mason-lspconfig').setup({
|
||||
ensure_installed = {
|
||||
"svelte",
|
||||
"clangd",
|
||||
"ts_ls",
|
||||
"pyright",
|
||||
"lua_ls"
|
||||
},
|
||||
automatic_enable = true,
|
||||
ensure_installed = {
|
||||
"svelte",
|
||||
"clangd",
|
||||
"ts_ls",
|
||||
"pyright",
|
||||
"lua_ls"
|
||||
},
|
||||
automatic_enable = true,
|
||||
})
|
||||
vim.lsp.config('svelte', {
|
||||
-- capabilities = svelte_lsp_capabilities,
|
||||
filetypes = { "svelte" },
|
||||
})
|
||||
|
||||
@@ -1,11 +1,18 @@
|
||||
vim.pack.add({
|
||||
'https://github.com/nvim-treesitter/nvim-treesitter'
|
||||
'https://github.com/nvim-treesitter/nvim-treesitter'
|
||||
})
|
||||
|
||||
require('nvim-treesitter').setup({})
|
||||
require('nvim-treesitter').install( {'lua','rust', 'javascript', 'zig', "c","typescript", "cpp","haskell","svelte","python", "vim", "vimdoc", "html" })
|
||||
require('nvim-treesitter').setup({
|
||||
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', {
|
||||
pattern = { 'python', 'lua' },
|
||||
callback = function() vim.treesitter.start() end,
|
||||
callback = function(args)
|
||||
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