New Neovim configuration
This commit is contained in:
@@ -4,14 +4,6 @@
|
||||
|
||||
local map = vim.keymap.set
|
||||
|
||||
-- Resume last Telescope search
|
||||
-- map(
|
||||
-- "n",
|
||||
-- "<leader>sx",
|
||||
-- require("telescope.builtin").resume,
|
||||
-- { noremap = true, silent = true, desc = "Resume Telescope" }
|
||||
-- )
|
||||
|
||||
-- Buffer management
|
||||
map("n", "<leader>bn", ":bnext<CR>", { noremap = true, silent = true, desc = "Next buffer" })
|
||||
map("n", "<leader>bp", ":bprevious<CR>", { noremap = true, silent = true, desc = "Previous buffer" })
|
||||
|
||||
@@ -30,7 +30,6 @@ require("lazy").setup({
|
||||
version = false, -- always use the latest git commit
|
||||
-- version = "*", -- try installing the latest stable version for plugins that support semver
|
||||
},
|
||||
install = { colorscheme = { "tokyonight", "habamax", "catppuccin" } },
|
||||
checker = { enabled = true }, -- automatically check for plugin updates
|
||||
performance = {
|
||||
rtp = {
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
-- Options are automatically loaded before lazy.nvim startup
|
||||
-- Default options that are always set: https://github.com/LazyVim/LazyVim/blob/main/lua/lazyvim/config/options.lua
|
||||
-- Add any additional options here
|
||||
|
||||
local opt = vim.opt
|
||||
|
||||
-- Line numbers
|
||||
@@ -16,6 +17,7 @@ opt.smartcase = true
|
||||
|
||||
-- Highlight current line
|
||||
opt.cursorline = true
|
||||
opt.cursorlineopt = "number"
|
||||
|
||||
-- Enable true color support
|
||||
opt.termguicolors = true
|
||||
@@ -24,9 +26,10 @@ opt.termguicolors = true
|
||||
opt.clipboard = "unnamedplus"
|
||||
|
||||
-- Indentation
|
||||
opt.expandtab = false
|
||||
opt.softtabstop = 8
|
||||
opt.shiftwidth = 8
|
||||
opt.tabstop = 8
|
||||
opt.expandtab = true
|
||||
opt.smartindent = true
|
||||
|
||||
-- Split behavior
|
||||
@@ -49,3 +52,7 @@ opt.foldlevel = 99 -- open all folds by default
|
||||
|
||||
-- Show file name and modified flag in the window bar
|
||||
opt.winbar = "%=%m %f"
|
||||
|
||||
-- Backup files
|
||||
opt.swapfile = false
|
||||
opt.backup = false
|
||||
|
||||
26
lazyvim/.config/nvim/lua/config/treesitter.lua
Normal file
26
lazyvim/.config/nvim/lua/config/treesitter.lua
Normal file
@@ -0,0 +1,26 @@
|
||||
require("nvim-treesitter.configs").setup({
|
||||
ensure_installed = {
|
||||
"c",
|
||||
"go",
|
||||
"gomod",
|
||||
"gowork",
|
||||
"gosum",
|
||||
"json",
|
||||
"lua",
|
||||
"markdown",
|
||||
"python",
|
||||
"zig",
|
||||
},
|
||||
highlight = {
|
||||
enabled = true,
|
||||
},
|
||||
incremental_selection = {
|
||||
enabled = true,
|
||||
keymaps = {
|
||||
init_selection = "gnn",
|
||||
node_incremental = "grn",
|
||||
scope_incremental = "grc",
|
||||
node_decremental = "grm",
|
||||
},
|
||||
},
|
||||
})
|
||||
@@ -1,13 +0,0 @@
|
||||
return {
|
||||
"nvim-telescope/telescope-file-browser.nvim",
|
||||
keys = {
|
||||
{
|
||||
"<leader>sB",
|
||||
":Telescope file_browser path=%:p:h=%:p:h<cr>",
|
||||
desc = "Browser Files",
|
||||
},
|
||||
},
|
||||
config = function()
|
||||
require("telescope").load_extension("file_browser")
|
||||
end,
|
||||
}
|
||||
61
lazyvim/.config/nvim/lua/plugins/lsp-config.lua
Normal file
61
lazyvim/.config/nvim/lua/plugins/lsp-config.lua
Normal file
@@ -0,0 +1,61 @@
|
||||
return {
|
||||
"neovim/nvim-lspconfig",
|
||||
|
||||
-- How to add an LSP for a specific programming language?
|
||||
-- 1. Use `:Mason` to install the corresponding LSP.
|
||||
-- 2. Add the configuration below. The syntax is `lspconfig.<name>.setup(...)`
|
||||
-- Hint (find <name> here): https://github.com/neovim/nvim-lspconfig/blob/master/doc/configs.md
|
||||
config = function()
|
||||
-- Set different settings for different languages' LSP.
|
||||
-- Support List: https://github.com/neovim/nvim-lspconfig/blob/master/doc/configs.md
|
||||
local lspconfig = require("lspconfig")
|
||||
|
||||
-- Case 1. For CMake Users
|
||||
-- $ cmake -DCMAKE_EXPORT_COMPILE_COMMANDS=ON .
|
||||
-- Case 2. For Bazel Users, use https://github.com/hedronvision/bazel-compile-commands-extractor
|
||||
-- Case 3. If you don't use any build tool and all files in a project use the same build flags
|
||||
-- Place your compiler flags in the compile_flags.txt file, located in the root directory
|
||||
-- of your project. Each line in the file should contain a single compiler flag.
|
||||
-- src: https://clangd.llvm.org/installation#compile_commandsjson
|
||||
lspconfig.clangd.setup({})
|
||||
lspconfig.gopls.setup({})
|
||||
lspconfig.bashls.setup({})
|
||||
lspconfig.zls.setup({})
|
||||
-- src: https://docs.astral.sh/ruff/editors/setup/#neovim
|
||||
lspconfig.ruff.setup({})
|
||||
lspconfig.pylsp.setup({
|
||||
settings = {
|
||||
-- configure plugins in pylsp
|
||||
pylsp = {
|
||||
plugins = {
|
||||
pyflakes = { enabled = false },
|
||||
pylint = { enabled = false },
|
||||
pycodestyle = { enabled = false },
|
||||
},
|
||||
},
|
||||
},
|
||||
})
|
||||
lspconfig.lua_ls.setup({
|
||||
settings = {
|
||||
Lua = {
|
||||
runtime = {
|
||||
-- Tell the language server which version of Lua you're using (most likely LuaJIT in the case of Neovim).
|
||||
version = "LuaJIT",
|
||||
},
|
||||
diagnostics = {
|
||||
-- Get the language server to recognize the `vim` global.
|
||||
globals = { "vim" },
|
||||
},
|
||||
workspace = {
|
||||
-- Make the server aware of Neovim runtime files.
|
||||
library = vim.api.nvim_get_runtime_file("", true),
|
||||
},
|
||||
-- Do not send telemetry data containing a randomized but unique identifier.
|
||||
telemetry = {
|
||||
enable = false,
|
||||
},
|
||||
},
|
||||
},
|
||||
})
|
||||
end,
|
||||
}
|
||||
10
lazyvim/.config/nvim/lua/plugins/meson-lpconfig.lua
Normal file
10
lazyvim/.config/nvim/lua/plugins/meson-lpconfig.lua
Normal file
@@ -0,0 +1,10 @@
|
||||
return {
|
||||
"mason-org/mason-lspconfig.nvim",
|
||||
dependencies = {
|
||||
"mason-org/mason.nvim",
|
||||
"neovim/nvim-lspconfig",
|
||||
},
|
||||
opts = {
|
||||
ensure_installed = { "pylsp", "lua_ls", "bash-language-server", "gopls", "clangd", "zls" },
|
||||
},
|
||||
}
|
||||
12
lazyvim/.config/nvim/lua/plugins/meson.lua
Normal file
12
lazyvim/.config/nvim/lua/plugins/meson.lua
Normal file
@@ -0,0 +1,12 @@
|
||||
return {
|
||||
"mason-org/mason.nvim",
|
||||
opts = {
|
||||
ui = {
|
||||
icons = {
|
||||
package_installed = "✓",
|
||||
package_pending = "➜",
|
||||
package_uninstalled = "✗",
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
5
lazyvim/.config/nvim/lua/plugins/telescope.lua
Normal file
5
lazyvim/.config/nvim/lua/plugins/telescope.lua
Normal file
@@ -0,0 +1,5 @@
|
||||
return {
|
||||
"nvim-telescope/telescope.nvim",
|
||||
tag = "0.1.8",
|
||||
dependencies = { "nvim-lua/plenary.nvim" },
|
||||
}
|
||||
Reference in New Issue
Block a user