feat(keybinds, lua func, cmp): QOL changes basically
- removed hindering material like nvim adding more comments upon pressing `Enter` - removed snippets, not needed + disrupted commenting - added more keybinds (telescope.nvim, wrap around pairs, venv selection) - added QOL changes like venv-selector + ecolog.nvim w/ - added blink.cmp provders (ecolog + convential commits)
This commit is contained in:
parent
57222dd239
commit
bd2f808931
13 changed files with 206 additions and 109 deletions
29
lua/plugins/completion.lua
Normal file → Executable file
29
lua/plugins/completion.lua
Normal file → Executable file
|
|
@ -2,13 +2,9 @@ return {
|
|||
{
|
||||
"saghen/blink.cmp",
|
||||
dependencies = {
|
||||
{ "rafamadriz/friendly-snippets" },
|
||||
{ "disrupted/blink-cmp-conventional-commits" }
|
||||
},
|
||||
version = "1.*",
|
||||
|
||||
---@module 'blink.cmp'
|
||||
---@type blink.cmp.Config
|
||||
|
||||
opts = {
|
||||
keymap = {
|
||||
preset = "none",
|
||||
|
|
@ -34,12 +30,12 @@ return {
|
|||
},
|
||||
["<S-Tab>"] = { "select_prev", "fallback" },
|
||||
["<CR>"] = { "select_and_accept", "fallback" },
|
||||
["<C-e>"] = { "hide", "fallback" },
|
||||
["<C-e>"] = { "show", "hide", "fallback" },
|
||||
},
|
||||
|
||||
completion = {
|
||||
trigger = {
|
||||
show_on_x_blocked_trigger_characters = { "." },
|
||||
show_on_x_blocked_trigger_characters = { ".", "[", "]", "(", ")", "/", '"' },
|
||||
},
|
||||
documentation = {
|
||||
auto_show = true,
|
||||
|
|
@ -50,8 +46,25 @@ return {
|
|||
},
|
||||
|
||||
sources = {
|
||||
default = { "lsp", "path", "snippets", "buffer" },
|
||||
default = { "lsp", "path", "ecolog", "conventional_commits" },
|
||||
min_keyword_length = 0,
|
||||
|
||||
providers = {
|
||||
ecolog = {
|
||||
name = "ecolog",
|
||||
module = "ecolog.integrations.cmp.blink_cmp"
|
||||
},
|
||||
|
||||
conventional_commits = {
|
||||
name = 'Conventional Commits',
|
||||
module = 'blink-cmp-conventional-commits',
|
||||
enabled = function()
|
||||
return vim.bo.filetype == 'gitcommit'
|
||||
end,
|
||||
opts = {
|
||||
},
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
signature = { enabled = true },
|
||||
|
|
|
|||
128
lua/plugins/dev-utils.lua
Normal file → Executable file
128
lua/plugins/dev-utils.lua
Normal file → Executable file
|
|
@ -1,37 +1,40 @@
|
|||
return {
|
||||
-- Parser that does syntax highlighting
|
||||
-- Make sure tree-sitter-cli is up-to-date!
|
||||
{
|
||||
"nvim-treesitter/nvim-treesitter",
|
||||
branch = 'master',
|
||||
lazy = false,
|
||||
branch = "main",
|
||||
build = ":TSUpdate",
|
||||
config = function()
|
||||
require("nvim-treesitter.configs").setup({
|
||||
ensure_installed = {
|
||||
"lua",
|
||||
"cpp",
|
||||
"java",
|
||||
"javascript",
|
||||
"bash",
|
||||
"python",
|
||||
"typescript",
|
||||
"css",
|
||||
"html",
|
||||
"jsdoc",
|
||||
"http",
|
||||
"sql",
|
||||
"ssh_config",
|
||||
"json",
|
||||
"tsx",
|
||||
"xml",
|
||||
"yaml",
|
||||
"nginx",
|
||||
"gitcommit",
|
||||
"gitignore",
|
||||
"cmake"
|
||||
},
|
||||
indent = { enable = true },
|
||||
highlight = { enable = true }
|
||||
require("nvim-treesitter").install({
|
||||
"lua",
|
||||
"cpp",
|
||||
"java",
|
||||
"javascript",
|
||||
"bash",
|
||||
"python",
|
||||
"typescript",
|
||||
"css",
|
||||
"html",
|
||||
"jsdoc",
|
||||
"http",
|
||||
"sql",
|
||||
"ssh_config",
|
||||
"json",
|
||||
"tsx",
|
||||
"xml",
|
||||
"yaml",
|
||||
"nginx",
|
||||
"gitcommit",
|
||||
"gitignore",
|
||||
"cmake"
|
||||
})
|
||||
|
||||
vim.api.nvim_create_autocmd("FileType", {
|
||||
callback = function(args)
|
||||
pcall(vim.treesitter.start, args.buf)
|
||||
end
|
||||
})
|
||||
end
|
||||
},
|
||||
|
|
@ -41,7 +44,15 @@ return {
|
|||
"windwp/nvim-autopairs",
|
||||
event = "InsertEnter",
|
||||
config = true,
|
||||
opts = {}
|
||||
opts = function()
|
||||
local npairs = require('nvim-autopairs')
|
||||
npairs.setup({
|
||||
fast_wrap = {
|
||||
map = "<D-i>",
|
||||
chars = { '{', '[', '(', '"', "'" },
|
||||
}
|
||||
})
|
||||
end
|
||||
},
|
||||
|
||||
-- Allows automatic tagging on HTML or JSON (E.g: <div>test</div> )
|
||||
|
|
@ -84,23 +95,56 @@ return {
|
|||
|
||||
-- Floating terminal
|
||||
{
|
||||
"numToStr/FTerm.nvim",
|
||||
"akinsho/toggleterm.nvim",
|
||||
version = "*",
|
||||
config = function()
|
||||
-- truly toggle floating terminal (auto closes floating terminal)
|
||||
-- thank you: https://github.com/numToStr/FTerm.nvim/issues/78#issuecomment-1432326116
|
||||
local function create_autocmd(pattern, key, term)
|
||||
vim.api.nvim_create_autocmd("FileType", {
|
||||
pattern = pattern,
|
||||
callback = function(event)
|
||||
local t = term
|
||||
vim.keymap.set("t", key, function() t:close() end, { buffer = event.buf, silent = true })
|
||||
end,
|
||||
})
|
||||
local Terminal = require("toggleterm.terminal").Terminal
|
||||
local newTerm = Terminal:new({
|
||||
direction = "float",
|
||||
on_open = function(term)
|
||||
vim.cmd("startinsert!")
|
||||
vim.api.nvim_buf_set_keymap(term.bufnr, "t", "<C-Space>", "<cmd>close<CR>", { noremap = true, silent = true })
|
||||
end,
|
||||
on_close = function()
|
||||
vim.cmd("startinsert!")
|
||||
end,
|
||||
})
|
||||
|
||||
function _Term_toggle()
|
||||
newTerm:toggle()
|
||||
end
|
||||
|
||||
local fterm = require("FTerm")
|
||||
fterm.setup({})
|
||||
create_autocmd("FTerm", "<C-Space>", fterm)
|
||||
vim.api.nvim_set_keymap("n", "<C-Space>", "<cmd>lua _Term_toggle()<CR>", { noremap = true, silent = true })
|
||||
end
|
||||
},
|
||||
|
||||
-- Helps with finding environmental variables
|
||||
{
|
||||
"philosofonusus/ecolog.nvim",
|
||||
branch = "v1",
|
||||
lazy = false,
|
||||
keys = {
|
||||
{ '<leader>ge', '<cmd>EcologGoto<cr>', desc = 'Go to env file' },
|
||||
{ '<leader>ep', '<cmd>EcologPeek<cr>', desc = 'Ecolog peek variable' },
|
||||
{ '<leader>es', '<cmd>EcologSelect<cr>', desc = 'Switch env file' },
|
||||
},
|
||||
opts = {
|
||||
integrations = {
|
||||
blink_cmp = true
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
-- For Python mainly
|
||||
-- Allows
|
||||
{
|
||||
"linux-cultist/venv-selector.nvim",
|
||||
ft = "python",
|
||||
opts = {
|
||||
options = {},
|
||||
search = {}
|
||||
},
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
0
lua/plugins/discord.lua
Normal file → Executable file
0
lua/plugins/discord.lua
Normal file → Executable file
3
lua/plugins/file-explorer.lua
Normal file → Executable file
3
lua/plugins/file-explorer.lua
Normal file → Executable file
|
|
@ -10,9 +10,8 @@ return {
|
|||
opts = {
|
||||
window = {
|
||||
mappings = {
|
||||
["P"] = "toggle_preview",
|
||||
["p"] = "toggle_preview",
|
||||
}
|
||||
}
|
||||
},
|
||||
}
|
||||
|
||||
|
|
|
|||
13
lua/plugins/formatter.lua
Normal file → Executable file
13
lua/plugins/formatter.lua
Normal file → Executable file
|
|
@ -5,9 +5,6 @@ return {
|
|||
event = { "BufWritePre" },
|
||||
cmd = { "ConformInfo" },
|
||||
|
||||
-- This will provide type hinting with LuaLS
|
||||
---@module "conform"
|
||||
---@type conform.setupOpts
|
||||
opts = {
|
||||
formatters_by_ft = {
|
||||
lua = { "stylua" },
|
||||
|
|
@ -17,19 +14,13 @@ return {
|
|||
sh = { "shfmt", "shellcheck" },
|
||||
bash = { "shfmt", "shellcheck" },
|
||||
},
|
||||
formatters = {
|
||||
prettier = {
|
||||
prepend_args = function()
|
||||
return { "" }
|
||||
end,
|
||||
},
|
||||
},
|
||||
default_format_opts = {
|
||||
lsp_format = "fallback",
|
||||
},
|
||||
format_on_save = {
|
||||
timeout_ms = 500,
|
||||
},
|
||||
lsp_format = "fallback"
|
||||
}
|
||||
},
|
||||
|
||||
init = function()
|
||||
|
|
|
|||
46
lua/plugins/lsp.lua
Normal file → Executable file
46
lua/plugins/lsp.lua
Normal file → Executable file
|
|
@ -52,6 +52,33 @@ return {
|
|||
init_options = { preferences = { disableSuggestions = false } },
|
||||
})
|
||||
|
||||
vim.lsp.config("pylsp", {
|
||||
settings = {
|
||||
pylsp = {
|
||||
plugins = {
|
||||
pycodestyle = {
|
||||
ignore = { "E501", "W503", "E265" },
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
})
|
||||
|
||||
local base_on_attach = vim.lsp.config.eslint.on_attach
|
||||
vim.lsp.config("pylsp", {
|
||||
on_attach = function(client, bufnr)
|
||||
if not base_on_attach then
|
||||
return
|
||||
end
|
||||
|
||||
base_on_attach(client, bufnr)
|
||||
vim.api.nvim_create_autocmd("BufWritePre", {
|
||||
buffer = bufnr,
|
||||
command = "LspEslintFixAll",
|
||||
})
|
||||
end,
|
||||
})
|
||||
|
||||
vim.lsp.enable({
|
||||
"lua_ls",
|
||||
"clangd",
|
||||
|
|
@ -61,19 +88,8 @@ return {
|
|||
"html",
|
||||
"tailwindcss",
|
||||
"pylsp",
|
||||
})
|
||||
end,
|
||||
},
|
||||
|
||||
{
|
||||
"esmuellert/nvim-eslint",
|
||||
config = function()
|
||||
require("nvim-eslint").setup({
|
||||
settings = {
|
||||
workingDirectory = function(bufnr)
|
||||
return { directory = vim.fs.root(bufnr, { "package.json" }) }
|
||||
end,
|
||||
},
|
||||
"eslint-lsp",
|
||||
"pyright",
|
||||
})
|
||||
end,
|
||||
},
|
||||
|
|
@ -89,6 +105,6 @@ return {
|
|||
},
|
||||
})
|
||||
vim.lsp.enable("jdtls")
|
||||
end
|
||||
}
|
||||
end,
|
||||
},
|
||||
}
|
||||
|
|
|
|||
0
lua/plugins/remote.lua
Normal file → Executable file
0
lua/plugins/remote.lua
Normal file → Executable file
7
lua/plugins/search.lua
Executable file
7
lua/plugins/search.lua
Executable file
|
|
@ -0,0 +1,7 @@
|
|||
return {
|
||||
'nvim-telescope/telescope.nvim',
|
||||
version = '*',
|
||||
dependencies = {
|
||||
'nvim-lua/plenary.nvim',
|
||||
}
|
||||
}
|
||||
0
lua/plugins/ui.lua
Normal file → Executable file
0
lua/plugins/ui.lua
Normal file → Executable file
Loading…
Add table
Add a link
Reference in a new issue