Skip to content

Commit 5cc4184

Browse files
committed
small tweaks to nvim config trying out a few packages. e.g autoparing {}
1 parent 7e39f5f commit 5cc4184

File tree

5 files changed

+56
-29
lines changed

5 files changed

+56
-29
lines changed

.config/nvim/init.lua

Lines changed: 35 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,10 @@ local function get_python_path()
88
end
99

1010
vim.g.python3_host_prog = get_python_path()
11-
print('python location', vim.g.python3_host_prog)
11+
-- Show python location without requiring input
12+
vim.schedule(function()
13+
vim.notify('Python location: ' .. (vim.g.python3_host_prog or 'not found'), vim.log.levels.INFO)
14+
end)
1215

1316
-- get_venv() used to print in lualine_y for python files
1417
local function get_venv(variable)
@@ -49,6 +52,27 @@ require('lazy').setup({
4952
'tpope/vim-rhubarb',
5053

5154
{'preservim/nerdcommenter', event = 'VimEnter'},
55+
56+
-- Motion and editing plugins
57+
{
58+
'ggandor/leap.nvim',
59+
config = function()
60+
require('leap').add_default_mappings()
61+
end
62+
},
63+
64+
{
65+
'echasnovski/mini.pairs',
66+
config = function()
67+
require('mini.pairs').setup({
68+
modes = { insert = true, command = false, terminal = false },
69+
mappings = {
70+
['"'] = { action = 'open', pair = '""', neigh_pattern = '[^%a\\].' },
71+
["'"] = { action = 'open', pair = "''", neigh_pattern = '[^%a\\].' }
72+
}
73+
})
74+
end
75+
},
5276
},
5377

5478
-- Neovim-only plugins
@@ -94,7 +118,16 @@ require('lazy').setup({
94118
},
95119

96120
-- Useful plugin to show you pending keybinds
97-
'folke/which-key.nvim',
121+
{
122+
'folke/which-key.nvim',
123+
opts = {
124+
icons = {
125+
breadcrumb = "»", -- symbol used in the command line area that shows your active key combo
126+
separator = "", -- symbol used between a key and it's label
127+
group = "+", -- symbol prepended to a group
128+
}
129+
}
130+
},
98131

99132
-- yanking with history
100133
'vim-scripts/YankRing.vim',
@@ -274,13 +307,6 @@ require('lazy').setup({
274307
},
275308
},
276309

277-
-- Luarocks package manager
278-
{
279-
"vhyrro/luarocks.nvim",
280-
priority = 1000, -- Very high priority is required, luarocks.nvim should run as the first plugin in your config.
281-
config = true,
282-
},
283-
284310
-- find things
285311
'mhinz/vim-grepper',
286312

.config/nvim/lua/custom/completion.lua

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,9 @@ if not snip_status_ok then
2222
return
2323
end
2424

25+
-- Disable jsregexp warning since we don't use transformations
26+
vim.g.luasnip_no_lsp_snippets_transformations = true
27+
2528
-- Define snippet helpers
2629
local s = luasnip.snippet
2730
local t = luasnip.text_node

.config/nvim/lua/custom/keymaps.lua

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
1-
-- Add this at the top of the file
2-
print("Loading keymaps.lua, vscode:", vim.g.vscode)
3-
41
--For the option key work as the <A> key in vim keymaps, set the (left) option to Esc+ in iTerm profiles.
52
local opts = { noremap = true }
63

@@ -22,15 +19,23 @@ vim.g.mapleader = ","
2219
vim.g.maplocalleader = ","
2320

2421
-- Common bindings (work in both VS Code and Neovim)
25-
print("Setting up kj escape binding")
2622
keymap("n", "<Leader>p", '"+p', opts) -- paste system clipboard
2723

24+
vim.schedule(function()
25+
vim.notify('Setting up kj escape binding', vim.log.levels.INFO)
26+
end)
27+
2828
-- Press kj fast for ESC
2929
keymap("i", "kj", "<ESC>", opts)
3030
keymap("v", "kj", "<ESC>", opts)
3131
keymap("x", "kj", "<ESC>", opts)
3232
keymap("c", "kj", "<ESC>", opts)
3333

34+
-- Show vscode status without requiring input
35+
vim.schedule(function()
36+
vim.notify('Loading keymaps.lua, vscode: ' .. tostring(vim.g.vscode), vim.log.levels.INFO)
37+
end)
38+
3439
if vim.g.vscode then
3540
-- VS Code specific LSP-like features
3641
keymap('n', 'gd', function() vim.fn.VSCodeNotify('editor.action.revealDefinition') end)

.config/nvim/lua/custom/none-ls.lua

Lines changed: 6 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -9,23 +9,13 @@ local null_ls = require("null-ls")
99
null_ls.setup({
1010
debug = true,
1111
sources = {
12-
null_ls.builtins.diagnostics.mypy.with({
13-
-- each python environment should have mypy installed
14-
-- don't run without vim.g.python3_host_prog environment; set in init.lua
15-
condition = function() return vim.g.python3_host_prog ~= nil end,
16-
-- milliseconds
17-
timeout = -1, --a negavite number prevents timeout
18-
--multiple_files = false,
19-
--[[extra_args = function()
20-
[ if vim.g.python3_host_prog ~= nil then
21-
[ return "--python-executable " .. vim.g.python3_host_prog
22-
[ end
23-
[end]]
24-
}),
25-
--null_ls.builtins.formatting.black,
26-
null_ls.builtins.formatting.stylua,
12+
-- Python formatting
13+
null_ls.builtins.formatting.black,
14+
-- Python linting
15+
null_ls.builtins.diagnostics.ruff,
16+
--null_ls.builtins.diagnostics.mypy,
17+
--null_ls.builtins.formatting.stylua,
2718
--null_ls.builtins.code_actions.proselint,
28-
--null_ls.builtins.diagnostics.ruff,
2919
--null_ls.builtins.diagnostics.eslint,
3020
--null_ls.builtins.completion.spell,
3121
}

.config/nvim/lua/custom/options.lua

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
vim.opt.autochdir = true
22
vim.o.termguicolors = true -- NOTE: You should make sure your terminal supports this
33

4+
-- Disable Perl provider since we don't use it
5+
vim.g.loaded_perl_provider = 0
6+
47
-- recommended for Avante: views can only be fully collapsed with the global statusline
58
vim.opt.laststatus = 3
69

0 commit comments

Comments
 (0)