mirror of
https://github.com/arkorty/Neolite.git
synced 2026-03-17 16:51:42 +00:00
Lazy commit message
This commit is contained in:
@@ -18,7 +18,7 @@ vim.g.maplocalleader = ";"
|
|||||||
-- Command Mode = 'c',
|
-- Command Mode = 'c',
|
||||||
|
|
||||||
-- Normal mode --
|
-- Normal mode --
|
||||||
-- Basic functions
|
-- Basic commands
|
||||||
bind("n", "<Leader>w", ":w<CR>", opts)
|
bind("n", "<Leader>w", ":w<CR>", opts)
|
||||||
bind("n", "<Leader>e", ":q<CR>", opts)
|
bind("n", "<Leader>e", ":q<CR>", opts)
|
||||||
bind("n", "<Leader>q", ":qa<CR>", opts)
|
bind("n", "<Leader>q", ":qa<CR>", opts)
|
||||||
@@ -52,22 +52,3 @@ bind("n", "<C-k>", ":resize -2<CR>", opts)
|
|||||||
bind("n", "<C-j>", ":resize +2<CR>", opts)
|
bind("n", "<C-j>", ":resize +2<CR>", opts)
|
||||||
bind("n", "<C-l>", ":vertical resize -2<CR>", opts)
|
bind("n", "<C-l>", ":vertical resize -2<CR>", opts)
|
||||||
bind("n", "<C-h>", ":vertical resize +2<CR>", opts)
|
bind("n", "<C-h>", ":vertical resize +2<CR>", opts)
|
||||||
|
|
||||||
-- Navigate tabs
|
|
||||||
bind("n", "<S-h>", ":tabp<CR>", opts)
|
|
||||||
bind("n", "<S-l>", ":tabn<CR>", opts)
|
|
||||||
|
|
||||||
-- Visual --
|
|
||||||
-- Stay in indent mode
|
|
||||||
bind("v", "<", "<gv", opts)
|
|
||||||
bind("v", ">", ">gv", opts)
|
|
||||||
|
|
||||||
-- Move text up and down
|
|
||||||
bind("v", "<S-k>", ":m .+1<CR>==", opts)
|
|
||||||
bind("v", "<S-j>", ":m .-2<CR>==", opts)
|
|
||||||
bind("v", "p", '"_dP', opts)
|
|
||||||
|
|
||||||
-- Visual Block --
|
|
||||||
-- Move text up and down
|
|
||||||
bind("x", "J", ":move '>+1<CR>gv-gv", opts)
|
|
||||||
bind("x", "K", ":move '<-2<CR>gv-gv", opts)
|
|
||||||
|
|||||||
@@ -28,7 +28,9 @@ local capabilities = cmp_nvim_lsp.default_capabilities()
|
|||||||
|
|
||||||
mason_lspconfig.setup_handlers({
|
mason_lspconfig.setup_handlers({
|
||||||
function(server)
|
function(server)
|
||||||
lspconfig[server].setup({ capabilities = capabilities })
|
lspconfig[server].setup({
|
||||||
|
capabilities = capabilities,
|
||||||
|
})
|
||||||
lspconfig.lua_ls.setup({
|
lspconfig.lua_ls.setup({
|
||||||
capabilities = capabilities,
|
capabilities = capabilities,
|
||||||
settings = {
|
settings = {
|
||||||
|
|||||||
@@ -3,16 +3,16 @@ if not ok then
|
|||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
||||||
local formatting = null_ls.builtins.formatting
|
|
||||||
|
|
||||||
local augroup = vim.api.nvim_create_augroup("LspFormatting", {})
|
local augroup = vim.api.nvim_create_augroup("LspFormatting", {})
|
||||||
null_ls.setup({
|
require("null-ls").setup({
|
||||||
sources = {
|
sources = {
|
||||||
formatting.rustfmt,
|
null_ls.builtins.formatting.rustfmt,
|
||||||
formatting.stylua,
|
null_ls.builtins.formatting.stylua,
|
||||||
formatting.black,
|
null_ls.builtins.formatting.black,
|
||||||
formatting.prettier,
|
null_ls.builtins.formatting.prettier,
|
||||||
}, -- you can reuse a shared lspconfig on_attach callback here
|
null_ls.builtins.formatting.clang_format,
|
||||||
|
},
|
||||||
|
-- you can reuse a shared lspconfig on_attach callback here
|
||||||
on_attach = function(client, bufnr)
|
on_attach = function(client, bufnr)
|
||||||
if client.supports_method("textDocument/formatting") then
|
if client.supports_method("textDocument/formatting") then
|
||||||
vim.api.nvim_clear_autocmds({ group = augroup, buffer = bufnr })
|
vim.api.nvim_clear_autocmds({ group = augroup, buffer = bufnr })
|
||||||
@@ -20,8 +20,12 @@ null_ls.setup({
|
|||||||
group = augroup,
|
group = augroup,
|
||||||
buffer = bufnr,
|
buffer = bufnr,
|
||||||
callback = function()
|
callback = function()
|
||||||
-- on 0.8, you should use vim.lsp.buf.format({ bufnr = bufnr }) instead
|
vim.lsp.buf.format({
|
||||||
vim.lsp.buf.format({ bufnr = bufnr })
|
bufnr = bufnr,
|
||||||
|
filter = function()
|
||||||
|
return client.name == "null-ls"
|
||||||
|
end,
|
||||||
|
})
|
||||||
end,
|
end,
|
||||||
})
|
})
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -70,7 +70,7 @@ packer.startup(function(use)
|
|||||||
run = function()
|
run = function()
|
||||||
local ntsi_ok, nvim_treesitter_install = pcall(require, "nvim-treesitter.install")
|
local ntsi_ok, nvim_treesitter_install = pcall(require, "nvim-treesitter.install")
|
||||||
if ntsi_ok then
|
if ntsi_ok then
|
||||||
local ts_update = nvim_treesitter_install.install.update({ with_sync = true })
|
local ts_update = nvim_treesitter_install.update({ with_sync = true })
|
||||||
ts_update()
|
ts_update()
|
||||||
end
|
end
|
||||||
end,
|
end,
|
||||||
|
|||||||
Reference in New Issue
Block a user