added snacks.nvim and improvements
This commit is contained in:
parent
d871422273
commit
5a15ff1175
14 changed files with 235 additions and 43 deletions
|
@ -31,5 +31,5 @@ require("lazy").setup({
|
|||
-- colorscheme that will be used when installing plugins.
|
||||
install = { colorscheme = { "neopywal" } },
|
||||
-- automatically check for plugin updates
|
||||
checker = { enabled = true },
|
||||
checker = { enabled = false },
|
||||
})
|
||||
|
|
49
lua/config/mappings.lua
Normal file
49
lua/config/mappings.lua
Normal file
|
@ -0,0 +1,49 @@
|
|||
local map = vim.keymap.set
|
||||
|
||||
-- Set mapleader
|
||||
vim.g.mapleader = " "
|
||||
|
||||
-- Disable arrow keys in normal, visual, and insert modes.
|
||||
local keys = { "<Up>", "<Down>", "<Left>", "<Right>" }
|
||||
for _, key in ipairs(keys) do
|
||||
map({ "n", "i", "v" }, key, "<Nop>", { noremap = true, silent = true })
|
||||
end
|
||||
|
||||
-- Toggle spellcheck (When working with LaTeX/Typst)
|
||||
local spelllangs = {"es_mx", "en_us"}
|
||||
local current_index = 1
|
||||
|
||||
function ToggleSpell()
|
||||
vim.o.spelllang = spelllangs[current_index]
|
||||
vim.o.spell = not vim.o.spell
|
||||
print("Spellcheck " .. (vim.o.spell and "enabled" or "disabled") .. ": " .. spelllangs[current_index])
|
||||
end
|
||||
|
||||
map("n", "<leader>ts", ":lua ToggleSpell()<CR>", { noremap = true, silent = true })
|
||||
|
||||
-- Toggle spellcheck language.
|
||||
function ToggleSpellLang()
|
||||
current_index = (current_index % #spelllangs) + 1
|
||||
vim.o.spelllang = spelllangs[current_index]
|
||||
print("Spelllang: " .. spelllangs[current_index])
|
||||
end
|
||||
|
||||
map("n", "<Leader>sp", ":lua ToggleSpellLang()<CR>", { noremap = true, silent = true })
|
||||
|
||||
-- Open terminal
|
||||
map("n", "<leader>t", "<cmd>8split | terminal<CR>", { noremap = true, silent = true })
|
||||
|
||||
-- Neotree
|
||||
map("n", "<C-b>", "<cmd>Neotree toggle<CR>", { desc = "open neotree"})
|
||||
|
||||
-- Telescope
|
||||
map("n", "<C-p>", "<cmd>Telescope find_files<CR>", { desc = "telescope find files" })
|
||||
map("n", "<C-g>", "<cmd>Telescope live_grep<CR>", { desc = "telescope live grep" })
|
||||
|
||||
-- Nonels
|
||||
map("n", "<leader>gf", vim.lsp.buf.format, {})
|
||||
|
||||
-- LSP Stuff
|
||||
map('n', 'K', vim.lsp.buf.hover, {})
|
||||
map('n', 'gd', vim.lsp.buf.definition, {})
|
||||
map({'n', 'v'}, '<space>ca', vim.lsp.buf.code_action, {})
|
|
@ -22,7 +22,7 @@
|
|||
{ name = 'nvim_lsp' },
|
||||
{ name = 'luasnip' }, -- For luasnip users.
|
||||
{ name = 'nvim_lua' },
|
||||
{ name = 'buffer' },
|
||||
-- { name = 'buffer' },
|
||||
{ name = 'path' },
|
||||
{ name = 'nvim_lsp_signature_help' },
|
||||
-- { name = 'cmdline' },
|
||||
|
|
|
@ -1,6 +1,2 @@
|
|||
local lspconfig = require("lspconfig")
|
||||
lspconfig.lua_ls.setup({})
|
||||
|
||||
vim.keymap.set('n', 'K', vim.lsp.buf.hover, {})
|
||||
vim.keymap.set('n', 'gd', vim.lsp.buf.definition, {})
|
||||
vim.keymap.set({'n', 'v'}, '<space>ca', vim.lsp.buf.code_action, {})
|
||||
|
|
|
@ -30,17 +30,17 @@ o.inccommand = "split"
|
|||
o.splitright = true
|
||||
o.splitbelow = true
|
||||
o.termguicolors = true
|
||||
|
||||
opt.shortmess:append "sI"
|
||||
opt.whichwrap:append "<>[]hl"
|
||||
opt.fillchars = { eob = " " }
|
||||
|
||||
o.updatetime = 250
|
||||
o.ignorecase = true
|
||||
o.incsearch = true
|
||||
o.smartcase = true
|
||||
o.mouse = "a"
|
||||
|
||||
opt.shortmess:append "sI"
|
||||
opt.whichwrap:append "<>[]hl"
|
||||
opt.fillchars = { eob = " " }
|
||||
opt.termguicolors = true
|
||||
|
||||
g.loaded_node_provider = 0
|
||||
g.loaded_python3_provider = 0
|
||||
g.loaded_perl_provider = 0
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue