mirror of
https://github.com/thegeneralist01/config.git
synced 2026-03-07 10:59:55 +01:00
nvim: formatting and minor fixes
This commit is contained in:
parent
b048858c40
commit
7282fcd409
5 changed files with 225 additions and 217 deletions
|
|
@ -1,84 +1,88 @@
|
|||
return {
|
||||
{
|
||||
"saghen/blink.cmp",
|
||||
dependencies = { "rafamadriz/friendly-snippets" },
|
||||
version = "1.*",
|
||||
opts = {
|
||||
-- 'default' (recommended) for mappings similar to built-in completions (C-y to accept)
|
||||
-- 'super-tab' for mappings similar to vscode (tab to accept)
|
||||
-- 'enter' for enter to accept
|
||||
-- 'none' for no mappings
|
||||
--
|
||||
-- All presets have the following mappings:
|
||||
-- C-space: Open menu or open docs if already open
|
||||
-- C-n/C-p or Up/Down: Select next/previous item
|
||||
-- C-e: Hide menu
|
||||
-- C-k: Toggle signature help (if signature.enabled = true)
|
||||
--
|
||||
-- See :h blink-cmp-config-keymap for defining your own keymap
|
||||
keymap = { preset = "default" },
|
||||
{
|
||||
"saghen/blink.cmp",
|
||||
dependencies = { "rafamadriz/friendly-snippets" },
|
||||
version = "1.*",
|
||||
opts = {
|
||||
-- 'default' (recommended) for mappings similar to built-in completions (C-y to accept)
|
||||
-- 'super-tab' for mappings similar to vscode (tab to accept)
|
||||
-- 'enter' for enter to accept
|
||||
-- 'none' for no mappings
|
||||
--
|
||||
-- All presets have the following mappings:
|
||||
-- C-space: Open menu or open docs if already open
|
||||
-- C-n/C-p or Up/Down: Select next/previous item
|
||||
-- C-e: Hide menu
|
||||
-- C-k: Toggle signature help (if signature.enabled = true)
|
||||
--
|
||||
-- See :h blink-cmp-config-keymap for defining your own keymap
|
||||
keymap = {
|
||||
preset = "default",
|
||||
["<Tab>"] = { "select_and_accept" },
|
||||
["<S-Tab>"] = { "select_next", "fallback_to_mappings" },
|
||||
},
|
||||
|
||||
appearance = {
|
||||
nerd_font_variant = "mono",
|
||||
},
|
||||
appearance = {
|
||||
nerd_font_variant = "mono",
|
||||
},
|
||||
|
||||
-- (Default) Only show the documentation popup when manually triggered
|
||||
completion = { documentation = { auto_show = false } },
|
||||
-- (Default) Only show the documentation popup when manually triggered
|
||||
completion = { documentation = { auto_show = false } },
|
||||
|
||||
-- Default list of enabled providers defined so that you can extend it
|
||||
-- elsewhere in your config, without redefining it, due to `opts_extend`
|
||||
sources = {
|
||||
default = { "lsp", "path", "snippets", "buffer" },
|
||||
},
|
||||
-- Default list of enabled providers defined so that you can extend it
|
||||
-- elsewhere in your config, without redefining it, due to `opts_extend`
|
||||
sources = {
|
||||
default = { "lsp", "path", "snippets", "buffer" },
|
||||
},
|
||||
|
||||
-- (Default) Rust fuzzy matcher for typo resistance and significantly better performance
|
||||
-- You may use a lua implementation instead by using `implementation = "lua"` or fallback to the lua implementation,
|
||||
-- when the Rust fuzzy matcher is not available, by using `implementation = "prefer_rust"`
|
||||
--
|
||||
-- See the fuzzy documentation for more information
|
||||
fuzzy = { implementation = "prefer_rust_with_warning" },
|
||||
},
|
||||
opts_extend = { "sources.default" },
|
||||
},
|
||||
-- (Default) Rust fuzzy matcher for typo resistance and significantly better performance
|
||||
-- You may use a lua implementation instead by using `implementation = "lua"` or fallback to the lua implementation,
|
||||
-- when the Rust fuzzy matcher is not available, by using `implementation = "prefer_rust"`
|
||||
--
|
||||
-- See the fuzzy documentation for more information
|
||||
fuzzy = { implementation = "prefer_rust_with_warning" },
|
||||
},
|
||||
opts_extend = { "sources.default" },
|
||||
},
|
||||
|
||||
-- {
|
||||
-- 'neovim/nvim-lspconfig',
|
||||
-- dependencies = {
|
||||
-- 'saghen/blink.cmp',
|
||||
-- 'williamboman/mason.nvim',
|
||||
-- 'mason-org/mason-registry',
|
||||
-- 'williamboman/mason-lspconfig.nvim',
|
||||
-- 'L3MON4D3/LuaSnip',
|
||||
-- 'saadparwaiz1/cmp_luasnip',
|
||||
-- 'j-hui/fidget.nvim',
|
||||
-- },
|
||||
--
|
||||
-- -- example using `opts` for defining servers
|
||||
-- opts = {
|
||||
-- servers = {
|
||||
-- lua_ls = {}
|
||||
-- }
|
||||
-- },
|
||||
-- config = function(_, opts)
|
||||
-- require("fidget").setup({})
|
||||
-- require("mason").setup()
|
||||
--
|
||||
-- local lspconfig = require('mason-lspconfig')
|
||||
-- for server, config in pairs(opts.servers) do
|
||||
-- -- passing config.capabilities to blink.cmp merges with the capabilities in your
|
||||
-- -- `opts[server].capabilities, if you've defined it
|
||||
-- print('configuring server:', server)
|
||||
-- config.capabilities = require('blink.cmp').get_lsp_capabilities(config.capabilities)
|
||||
-- require("lspconfig")[server].setup(config)
|
||||
-- end
|
||||
-- end
|
||||
--
|
||||
-- example calling setup directly for each LSP
|
||||
-- config = function()
|
||||
-- local capabilities = require('blink.cmp').get_lsp_capabilities()
|
||||
-- local lspconfig = require('lspconfig')
|
||||
--
|
||||
-- lspconfig['lua_ls'].setup({ capabilities = capabilities })
|
||||
-- end
|
||||
-- },
|
||||
-- {
|
||||
-- 'neovim/nvim-lspconfig',
|
||||
-- dependencies = {
|
||||
-- 'saghen/blink.cmp',
|
||||
-- 'williamboman/mason.nvim',
|
||||
-- 'mason-org/mason-registry',
|
||||
-- 'williamboman/mason-lspconfig.nvim',
|
||||
-- 'L3MON4D3/LuaSnip',
|
||||
-- 'saadparwaiz1/cmp_luasnip',
|
||||
-- 'j-hui/fidget.nvim',
|
||||
-- },
|
||||
--
|
||||
-- -- example using `opts` for defining servers
|
||||
-- opts = {
|
||||
-- servers = {
|
||||
-- lua_ls = {}
|
||||
-- }
|
||||
-- },
|
||||
-- config = function(_, opts)
|
||||
-- require("fidget").setup({})
|
||||
-- require("mason").setup()
|
||||
--
|
||||
-- local lspconfig = require('mason-lspconfig')
|
||||
-- for server, config in pairs(opts.servers) do
|
||||
-- -- passing config.capabilities to blink.cmp merges with the capabilities in your
|
||||
-- -- `opts[server].capabilities, if you've defined it
|
||||
-- print('configuring server:', server)
|
||||
-- config.capabilities = require('blink.cmp').get_lsp_capabilities(config.capabilities)
|
||||
-- require("lspconfig")[server].setup(config)
|
||||
-- end
|
||||
-- end
|
||||
--
|
||||
-- example calling setup directly for each LSP
|
||||
-- config = function()
|
||||
-- local capabilities = require('blink.cmp').get_lsp_capabilities()
|
||||
-- local lspconfig = require('lspconfig')
|
||||
--
|
||||
-- lspconfig['lua_ls'].setup({ capabilities = capabilities })
|
||||
-- end
|
||||
-- },
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,101 +1,106 @@
|
|||
return {
|
||||
{
|
||||
"lukas-reineke/indent-blankline.nvim",
|
||||
main = "ibl",
|
||||
---@module "ibl"
|
||||
---@type ibl.config
|
||||
opts = {},
|
||||
},
|
||||
--[[ {
|
||||
{
|
||||
"lukas-reineke/indent-blankline.nvim",
|
||||
main = "ibl",
|
||||
---@module "ibl"
|
||||
---@type ibl.config
|
||||
opts = {},
|
||||
},
|
||||
--[[ {
|
||||
'boganworld/crackboard.nvim',
|
||||
dependencies = { 'nvim-lua/plenary.nvim' },
|
||||
opts = {
|
||||
session_key = 'redacted',
|
||||
},
|
||||
}, ]]
|
||||
{
|
||||
"onsails/lspkind-nvim",
|
||||
},
|
||||
-- {
|
||||
-- "ziglang/zig.vim",
|
||||
-- },
|
||||
{
|
||||
"nvim-lua/plenary.nvim",
|
||||
name = "plenary",
|
||||
},
|
||||
{
|
||||
"stevearc/oil.nvim",
|
||||
config = function()
|
||||
require("oil").setup()
|
||||
end,
|
||||
},
|
||||
-- {
|
||||
-- -- https://github.com/zbirenbaum/copilot.lua
|
||||
-- "zbirenbaum/copilot.lua",
|
||||
-- cmd = "Copilot",
|
||||
-- event = "InsertEnter",
|
||||
-- config = function()
|
||||
-- require("copilot").setup({
|
||||
-- panel = {
|
||||
-- keymap = {
|
||||
-- jump_prev = "]]",
|
||||
-- jump_next = "[[",
|
||||
-- accept = "<Tab>",
|
||||
-- refresh = "gr",
|
||||
-- open = "<M-]>",
|
||||
-- },
|
||||
-- },
|
||||
-- suggestion = {
|
||||
-- auto_trigger = true,
|
||||
-- keymap = {
|
||||
-- accept = "<M-Tab>",
|
||||
-- },
|
||||
-- },
|
||||
-- })
|
||||
-- -- vim.keymap.set("n", "<leader>cpe", "<cmd>Copilot enable<CR>")
|
||||
-- -- vim.keymap.set("n", "<leader>cpd", "<cmd>Copilot disable<CR>")
|
||||
-- end,
|
||||
-- },
|
||||
{
|
||||
"github/copilot.vim",
|
||||
config = function()
|
||||
-- set <leader>cpd and <leader>cpe to disable/enable copilot
|
||||
vim.keymap.set("n", "<leader>cpe", "<cmd>Copilot enable<CR>")
|
||||
vim.keymap.set("n", "<leader>cpd", "<cmd>Copilot disable<CR>")
|
||||
end,
|
||||
},
|
||||
-- {
|
||||
-- "Exafunction/codeium.nvim",
|
||||
-- dependencies = {
|
||||
-- "nvim-lua/plenary.nvim",
|
||||
-- "hrsh7th/nvim-cmp",
|
||||
-- },
|
||||
-- config = function()
|
||||
-- require("codeium").setup({
|
||||
-- -- https://github.com/Exafunction/codeium.vim
|
||||
-- })
|
||||
-- end
|
||||
-- },
|
||||
{
|
||||
"ldelossa/gh.nvim",
|
||||
dependencies = {
|
||||
"ldelossa/litee.nvim",
|
||||
},
|
||||
},
|
||||
"eandrju/cellular-automaton.nvim",
|
||||
"gpanders/editorconfig.nvim",
|
||||
{
|
||||
"onsails/lspkind-nvim",
|
||||
},
|
||||
-- {
|
||||
-- "ziglang/zig.vim",
|
||||
-- },
|
||||
{
|
||||
"nvim-lua/plenary.nvim",
|
||||
name = "plenary",
|
||||
},
|
||||
{
|
||||
"stevearc/oil.nvim",
|
||||
config = function()
|
||||
require("oil").setup()
|
||||
end,
|
||||
},
|
||||
-- {
|
||||
-- -- https://github.com/zbirenbaum/copilot.lua
|
||||
-- "zbirenbaum/copilot.lua",
|
||||
-- cmd = "Copilot",
|
||||
-- event = "InsertEnter",
|
||||
-- config = function()
|
||||
-- require("copilot").setup({
|
||||
-- panel = {
|
||||
-- keymap = {
|
||||
-- jump_prev = "]]",
|
||||
-- jump_next = "[[",
|
||||
-- accept = "<Tab>",
|
||||
-- refresh = "gr",
|
||||
-- open = "<M-]>",
|
||||
-- },
|
||||
-- },
|
||||
-- suggestion = {
|
||||
-- auto_trigger = true,
|
||||
-- keymap = {
|
||||
-- accept = "<M-Tab>",
|
||||
-- },
|
||||
-- },
|
||||
-- })
|
||||
-- -- vim.keymap.set("n", "<leader>cpe", "<cmd>Copilot enable<CR>")
|
||||
-- -- vim.keymap.set("n", "<leader>cpd", "<cmd>Copilot disable<CR>")
|
||||
-- end,
|
||||
-- },
|
||||
{
|
||||
"github/copilot.vim",
|
||||
config = function()
|
||||
-- set <leader>cpd and <leader>cpe to disable/enable copilot
|
||||
vim.keymap.set("n", "<leader>cpe", "<cmd>Copilot enable<CR>")
|
||||
vim.keymap.set("n", "<leader>cpd", "<cmd>Copilot disable<CR>")
|
||||
vim.keymap.set("i", "<C-J>", 'copilot#Accept("\\<CR>")', {
|
||||
expr = true,
|
||||
replace_keycodes = false,
|
||||
})
|
||||
vim.g.copilot_no_tab_map = true
|
||||
end,
|
||||
},
|
||||
-- {
|
||||
-- "Exafunction/codeium.nvim",
|
||||
-- dependencies = {
|
||||
-- "nvim-lua/plenary.nvim",
|
||||
-- "hrsh7th/nvim-cmp",
|
||||
-- },
|
||||
-- config = function()
|
||||
-- require("codeium").setup({
|
||||
-- -- https://github.com/Exafunction/codeium.vim
|
||||
-- })
|
||||
-- end
|
||||
-- },
|
||||
{
|
||||
"ldelossa/gh.nvim",
|
||||
dependencies = {
|
||||
"ldelossa/litee.nvim",
|
||||
},
|
||||
},
|
||||
"eandrju/cellular-automaton.nvim",
|
||||
"gpanders/editorconfig.nvim",
|
||||
|
||||
-- Useful for getting pretty icons, but requires a Nerd Font.
|
||||
{ "nvim-tree/nvim-web-devicons", enabled = vim.g.have_nerd_font },
|
||||
"lambdalisue/nerdfont.vim",
|
||||
"junegunn/vim-easy-align",
|
||||
"rcarriga/nvim-notify",
|
||||
-- Useful for getting pretty icons, but requires a Nerd Font.
|
||||
{ "nvim-tree/nvim-web-devicons", enabled = vim.g.have_nerd_font },
|
||||
"lambdalisue/nerdfont.vim",
|
||||
"junegunn/vim-easy-align",
|
||||
"rcarriga/nvim-notify",
|
||||
|
||||
-- Highlight todo, notes, etc in comments
|
||||
{
|
||||
"folke/todo-comments.nvim",
|
||||
event = "VimEnter",
|
||||
dependencies = { "nvim-lua/plenary.nvim" },
|
||||
opts = { signs = false },
|
||||
},
|
||||
-- Highlight todo, notes, etc in comments
|
||||
{
|
||||
"folke/todo-comments.nvim",
|
||||
event = "VimEnter",
|
||||
dependencies = { "nvim-lua/plenary.nvim" },
|
||||
opts = { signs = false },
|
||||
},
|
||||
}
|
||||
|
|
|
|||
|
|
@ -43,7 +43,6 @@ return {
|
|||
"ts_ls",
|
||||
"cssls",
|
||||
"tailwindcss",
|
||||
"pyright",
|
||||
},
|
||||
handlers = {
|
||||
function(server_name) -- default handler (optional)
|
||||
|
|
|
|||
|
|
@ -5,47 +5,46 @@ These three tabs are necessary when dealing with this nonsense:
|
|||
- https://github.com/nvimtools/none-ls.nvim
|
||||
--]]
|
||||
return {
|
||||
"jay-babu/mason-null-ls.nvim",
|
||||
event = { "BufReadPre", "BufNewFile" },
|
||||
dependencies = {
|
||||
"williamboman/mason.nvim",
|
||||
"nvimtools/none-ls.nvim",
|
||||
"nvimtools/none-ls-extras.nvim",
|
||||
},
|
||||
config = function()
|
||||
local null_ls = require("null-ls")
|
||||
require("mason-null-ls").setup({
|
||||
ensure_installed = {
|
||||
"stylua",
|
||||
"jq",
|
||||
"mypy",
|
||||
"ruff",
|
||||
"black",
|
||||
},
|
||||
handlers = {
|
||||
["mypy"] = function(source_name, methods)
|
||||
local options = {
|
||||
extra_args = function()
|
||||
local command = "which python"
|
||||
local handle = io.popen(command)
|
||||
local python_path = ""
|
||||
if handle then
|
||||
python_path = handle:read("*a")
|
||||
python_path = string.gsub(python_path, "\n", "")
|
||||
handle:close()
|
||||
end
|
||||
return { "--python-executable", python_path }
|
||||
end,
|
||||
}
|
||||
null_ls.register(null_ls.builtins.diagnostics.mypy.with(options))
|
||||
end,
|
||||
--[[ ["ruff"] = function(source_name, methods)
|
||||
"jay-babu/mason-null-ls.nvim",
|
||||
event = { "BufReadPre", "BufNewFile" },
|
||||
dependencies = {
|
||||
"williamboman/mason.nvim",
|
||||
"nvimtools/none-ls.nvim",
|
||||
"nvimtools/none-ls-extras.nvim",
|
||||
},
|
||||
config = function()
|
||||
local null_ls = require("null-ls")
|
||||
require("mason-null-ls").setup({
|
||||
ensure_installed = {
|
||||
"stylua",
|
||||
"jq",
|
||||
"basedpyright",
|
||||
"black",
|
||||
},
|
||||
handlers = {
|
||||
-- ["mypy"] = function(source_name, methods)
|
||||
-- local options = {
|
||||
-- extra_args = function()
|
||||
-- local command = "which python"
|
||||
-- local handle = io.popen(command)
|
||||
-- local python_path = ""
|
||||
-- if handle then
|
||||
-- python_path = handle:read("*a")
|
||||
-- python_path = string.gsub(python_path, "\n", "")
|
||||
-- handle:close()
|
||||
-- end
|
||||
-- return { "--python-executable", python_path }
|
||||
-- end,
|
||||
-- }
|
||||
-- null_ls.register(null_ls.builtins.diagnostics.mypy.with(options))
|
||||
-- end,
|
||||
--[[ ["ruff"] = function(source_name, methods)
|
||||
null_ls.register(null_ls.builtins.diagnostics.ruff)
|
||||
--require('mason-null-ls').default_setup(source_name, methods) -- to maintain default behavior
|
||||
end, ]]
|
||||
},
|
||||
})
|
||||
},
|
||||
})
|
||||
|
||||
null_ls.setup()
|
||||
end,
|
||||
null_ls.setup()
|
||||
end,
|
||||
}
|
||||
|
|
|
|||
|
|
@ -16,10 +16,10 @@ vim.keymap.set("n", "n", "nzzzv")
|
|||
vim.keymap.set("n", "N", "Nzzzv")
|
||||
|
||||
vim.keymap.set("n", "<leader>vwm", function()
|
||||
require("vim-with-me").StartVimWithMe()
|
||||
require("vim-with-me").StartVimWithMe()
|
||||
end)
|
||||
vim.keymap.set("n", "<leader>svwm", function()
|
||||
require("vim-with-me").StopVimWithMe()
|
||||
require("vim-with-me").StopVimWithMe()
|
||||
end)
|
||||
|
||||
vim.keymap.set("n", "<leader>vs", "<C-w>v")
|
||||
|
|
@ -54,19 +54,19 @@ vim.keymap.set("n", "<leader>vpp", "<cmd>e ~/.dotfiles/nvim/.config/nvim/lua/the
|
|||
vim.keymap.set("n", "<leader>mr", "<cmd>CellularAutomaton make_it_rain<CR>")
|
||||
|
||||
vim.keymap.set("n", "<leader><leader>", function()
|
||||
vim.cmd("so")
|
||||
vim.cmd("so")
|
||||
end)
|
||||
|
||||
vim.keymap.set("n", "zh", "$viBhzf", {
|
||||
desc = "Fold { block",
|
||||
desc = "Fold { block",
|
||||
})
|
||||
|
||||
vim.keymap.set("n", "zj", "$vi[hzf", {
|
||||
desc = "Fold [ block",
|
||||
desc = "Fold [ block",
|
||||
})
|
||||
|
||||
vim.keymap.set("n", "zk", "$vibhzf", {
|
||||
desc = "Fold ( block",
|
||||
desc = "Fold ( block",
|
||||
})
|
||||
|
||||
vim.keymap.set("n", "ga", "<cmd>EasyAlign<CR>")
|
||||
|
|
@ -77,6 +77,7 @@ vim.keymap.set("v", "<", "<gv")
|
|||
vim.keymap.set("v", ">", ">gv")
|
||||
|
||||
-- Indent with tab
|
||||
vim.keymap.set("i", "<Tab>", "<Tab>")
|
||||
vim.keymap.set("v", "<Tab>", ">gv")
|
||||
vim.keymap.set("v", "<S-Tab>", "<gv")
|
||||
|
||||
|
|
@ -84,9 +85,9 @@ vim.keymap.set("v", "<S-Tab>", "<gv")
|
|||
vim.keymap.set("n", "<C-w>e", "<C-w>j<C-w>q")
|
||||
|
||||
vim.keymap.set("n", "<leader>w", function()
|
||||
vim.ui.input({ prompt = "Enter value for shiftwidth: " }, function(input)
|
||||
vim.o.shiftwidth = tonumber(input)
|
||||
end)
|
||||
vim.ui.input({ prompt = "Enter value for shiftwidth: " }, function(input)
|
||||
vim.o.shiftwidth = tonumber(input)
|
||||
end)
|
||||
end)
|
||||
-- vim.keymap.set("n", "<leader>tc", function()
|
||||
-- -- local file_number = tonumber(vim.fn.input("File number > "), 10)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue