update neovim config AGAIN :(
This commit is contained in:
@@ -1,7 +1,6 @@
|
||||
local augroup = vim.api.nvim_create_augroup
|
||||
local gib_group = augroup('Gib', {})
|
||||
local autocmd = vim.api.nvim_create_autocmd
|
||||
local createcmd = vim.api.nvim_create_user_command
|
||||
local yank_group = augroup('HighlightYank', {})
|
||||
|
||||
function R(name)
|
||||
@@ -34,8 +33,8 @@ autocmd('LspAttach', {
|
||||
group = gib_group,
|
||||
callback = function(e)
|
||||
local opts = { buffer = e.buf }
|
||||
vim.keymap.set('n', '<leader>kf', vim.lsp.buf.format)
|
||||
vim.keymap.set("n", "gd", function() vim.lsp.buf.definition() end, opts)
|
||||
vim.keymap.set('n', '<leader>kf', function() vim.lsp.buf.format() end, opts)
|
||||
vim.keymap.set("n", "<leader>gd", function() vim.lsp.buf.definition() end, opts)
|
||||
vim.keymap.set("n", "<leader>kw", function() vim.lsp.buf.workspace_symbol() end, opts)
|
||||
vim.keymap.set("n", "<leader>kd", function() vim.diagnostic.open_float() end, opts)
|
||||
vim.keymap.set("n", "<leader>vca", function() vim.lsp.buf.code_action() end, opts)
|
||||
@@ -44,18 +43,3 @@ autocmd('LspAttach', {
|
||||
vim.keymap.set("i", "<C-h>", function() vim.lsp.buf.signature_help() end, opts)
|
||||
end
|
||||
})
|
||||
|
||||
createcmd("Format", function(args)
|
||||
local range
|
||||
if args.count ~= -1 then
|
||||
local start_line = vim.fn.line("'<")
|
||||
local end_line = vim.fn.line("'>")
|
||||
range = { start = { start_line, 0 }, ["end"] = { end_line, 0 } }
|
||||
end
|
||||
require("conform").format({
|
||||
async = true,
|
||||
lsp_fallback = true, -- if no external formatter, use LSP
|
||||
range = range,
|
||||
})
|
||||
end, { range = true, desc = "Format current buffer or range" })
|
||||
vim.keymap.set({ "n", "v" }, "<leader>fk", ":Format<CR>", { silent = true, desc = "Format" })
|
||||
|
@@ -1,4 +1,4 @@
|
||||
require('config.options')
|
||||
require('config.keymaps')
|
||||
require('plugins')
|
||||
require('config.autocmd')
|
||||
require'config.options'
|
||||
require'config.keymaps'
|
||||
require'config.lazy'
|
||||
require'config.autocmd'
|
||||
|
@@ -1,4 +1,5 @@
|
||||
vim.g.mapleader = ' '
|
||||
vim.g.maplocalleader = "\\"
|
||||
vim.keymap.set('n', '<leader><leader>s', ':update<CR> :source<CR>')
|
||||
vim.keymap.set('n', '<leader><leader>x', ':!chmod +x %<CR>', { silent = true })
|
||||
vim.keymap.set({'n', 'v', 'x'}, '<leader>h', '<C-w>h')
|
||||
|
28
configs/dotfiles/nvim/lua/config/lazy.lua
Normal file
28
configs/dotfiles/nvim/lua/config/lazy.lua
Normal file
@@ -0,0 +1,28 @@
|
||||
local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
|
||||
if not (vim.uv or vim.loop).fs_stat(lazypath) then
|
||||
local lazyrepo = "https://github.com/folke/lazy.nvim.git"
|
||||
local out = vim.fn.system({
|
||||
"git",
|
||||
"clone",
|
||||
"--filter=blob:none",
|
||||
"--branch=stable",
|
||||
lazyrepo,
|
||||
lazypath
|
||||
})
|
||||
if vim.v.shell_error ~= 0 then
|
||||
vim.api.nvim_echo({
|
||||
{ "Failed to clone lazy.nvim:\n", "ErrorMsg" },
|
||||
{ out, "WarningMsg" },
|
||||
{ "\nPress any key to exit..." },
|
||||
}, true, {})
|
||||
vim.fn.getchar()
|
||||
os.exit(1)
|
||||
end
|
||||
end
|
||||
vim.opt.rtp:prepend(lazypath)
|
||||
|
||||
require'lazy'.setup({
|
||||
spec = { { import = 'plugins' } },
|
||||
install = { colorscheme = { 'tokyonight-moon' } },
|
||||
checker = { enabled = true },
|
||||
})
|
@@ -1,6 +1,6 @@
|
||||
vim.o.number = true
|
||||
vim.o.relativenumber = true
|
||||
vim.o.winborder = 'rounded'
|
||||
--vim.o.winborder = 'rounded'
|
||||
vim.o.tabstop = 2
|
||||
vim.o.softtabstop = 2
|
||||
vim.o.shiftwidth = 2
|
||||
|
Reference in New Issue
Block a user