Updates for nvim v0.12
This commit is contained in:
parent
c62617cf3c
commit
8f1e635b23
|
|
@ -119,7 +119,7 @@ function pp
|
|||
if test -n "$selection"
|
||||
cd "$selection"
|
||||
commandline -f repaint # Ensures the prompt updates after cd
|
||||
nvim .
|
||||
nvim
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
vim.g.mapleader = " "
|
||||
vim.g.termguicolors = true
|
||||
vim.o.path = "**"
|
||||
vim.o.nu = true
|
||||
vim.o.cursorline = true
|
||||
|
|
@ -16,30 +17,54 @@ vim.o.list = true
|
|||
vim.o.splitright = true
|
||||
vim.o.splitbelow = true
|
||||
vim.o.winborder = 'rounded'
|
||||
vim.o.undodir = os.getenv("HOME") .. "/.cache/nvim/undodir"
|
||||
vim.g.gutentags_cache_dir = os.getenv("HOME") .. "/.cache/nvim/tags"
|
||||
vim.opt.clipboard = "unnamedplus"
|
||||
vim.o.completeopt = 'menuone,noselect'
|
||||
vim.o.undodir = os.getenv("HOME") .. "/.cache/nvim/undodir"
|
||||
vim.env.PATH = vim.env.PATH .. ":" .. os.getenv("HOME") .. "/.local/share/fnm/aliases/default/bin"
|
||||
vim.api.nvim_create_autocmd("BufEnter", { pattern = "term://*", callback = function() vim.cmd("startinsert") end })
|
||||
|
||||
vim.cmd(":colorscheme retrobox")
|
||||
pcall(require, "plugins")
|
||||
vim.api.nvim_create_autocmd("BufEnter", { pattern = "term://*", callback = function() vim.cmd("startinsert") end })
|
||||
vim.lsp.enable({ "gopls", "gdscript" })
|
||||
|
||||
vim.pack.add({
|
||||
{ src = "https://github.com/ibhagwan/fzf-lua" },
|
||||
{ src = "https://github.com/tribela/transparent.nvim" },
|
||||
{ src = "https://github.com/neovim/nvim-lspconfig" },
|
||||
{ src = "https://github.com/nvim-treesitter/nvim-treesitter", version = "main" },
|
||||
{ src="https://github.com/folke/trouble.nvim" }
|
||||
})
|
||||
require("fzf-lua").setup()
|
||||
require("trouble").setup()
|
||||
vim.api.nvim_create_autocmd('FileType', {
|
||||
pattern = '*',
|
||||
callback = function()
|
||||
pcall(vim.treesitter.start)
|
||||
vim.bo.indentexpr = "v:lua.require'nvim-treesitter'.indentexpr()"
|
||||
end,
|
||||
})
|
||||
|
||||
local map = vim.keymap.set
|
||||
map({"t", "n"}, "<C-h>", "<C-\\><C-n><C-w><C-h>")
|
||||
map({"t", "n"}, "<C-j>", "<C-\\><C-n><C-w><C-j>")
|
||||
map({"t", "n"}, "<C-k>", "<C-\\><C-n><C-w><C-k>")
|
||||
map({"t", "n"}, "<C-l>", "<C-\\><C-n><C-w><C-l>")
|
||||
map("i", "<C-Space>", "<C-x><C-n>")
|
||||
map({"i", "n"}, "<C- >", "<C-x><C-o>")
|
||||
map("n", '<Esc>', '<Cmd>noh<CR><Esc>')
|
||||
map("t", "<ESC><ESC>", "<C-\\><C-n>")
|
||||
map("v", "J", ":m '>+1<CR>gv=gv")
|
||||
map("v", "K", ":m '<-2<CR>gv=gv")
|
||||
map("v", "<S-Tab>", "<gv")
|
||||
map("v", "<Tab>" , ">gv")
|
||||
map("n", "gd", ":lua vim.lsp.buf.definition()<CR>")
|
||||
map("n", "<leader>p", "<cmd>b#<CR>")
|
||||
map("n", "<leader>e", ":Ex<CR>")
|
||||
map("n", "<leader>c", ":bd<CR>")
|
||||
map("n", "<leader>ff", ":lua FzfLua.files()<CR>")
|
||||
map("n", "<leader>fo", ":lua FzfLua.buffers()<CR>")
|
||||
map("n", "<leader>sp", ":lua FzfLua.grep_project()<CR>")
|
||||
map("n", "<leader>sf", ":lua FzfLua.grep_curbuf()<CR>")
|
||||
map("n", "<leader>sw", ":lua FzfLua.grep_cword()<CR>")
|
||||
map("n", "<leader>sh", ":lua FzfLua.help_tags()<CR>")
|
||||
map("n", "<leader>pa", ":lua FzfLua.lsp_code_actions()<CR>")
|
||||
map('n', '<leader>pp', ":Trouble diagnostics toggle<CR>")
|
||||
map("n", "<leader>1", ":vsplit | vertical resize 95 | terminal<CR>a")
|
||||
map("n", "<leader>2", ":split | horizontal resize 25 | terminal<CR>a")
|
||||
map("n", "<leader>r", ":split | resize 25 | terminal godot --path . <CR>a")
|
||||
|
|
|
|||
|
|
@ -1,63 +0,0 @@
|
|||
vim.pack.add({
|
||||
{ src = "https://github.com/ibhagwan/fzf-lua" },
|
||||
{ src = "https://github.com/tribela/transparent.nvim" },
|
||||
{ src = "https://github.com/nvim-treesitter/nvim-treesitter", version = "master" },
|
||||
})
|
||||
|
||||
local map = vim.keymap.set
|
||||
|
||||
local ok_fzf, fzf = pcall(require, "fzf-lua")
|
||||
if ok_fzf then
|
||||
fzf.setup({
|
||||
files = {
|
||||
cmd = (function()
|
||||
if vim.fn.findfile("project.godot", vim.fn.getcwd() .. ";") ~= "" then
|
||||
return "fdfind --type f -e gd -e gdshader -e gdshaderinc -e tres -e tscn -e cfg -e json -e toml -e txt -e md --exclude={.godot,.git}"
|
||||
else
|
||||
return "fdfind --exclude={.git,.cache,.xmake,.zig-cache,build,tmp,node_modules,elpa} --type f -H"
|
||||
end
|
||||
end)(),
|
||||
},
|
||||
})
|
||||
|
||||
map("n", "<leader>ff", function() fzf.files() end)
|
||||
map("n", "<leader>fo", function() fzf.buffers() end)
|
||||
map("n", "<leader>sp", function() fzf.grep_project() end)
|
||||
map("n", "<leader>sf", function() fzf.grep_curbuf() end)
|
||||
map("n", "<leader>sw", function() fzf.grep_cword() end)
|
||||
map("n", "<leader>sh", function() fzf.help_tags() end)
|
||||
end
|
||||
|
||||
local ok_ts, ts = pcall(require, "nvim-treesitter.configs")
|
||||
if ok_ts then
|
||||
ts.setup({
|
||||
ensure_installed = {
|
||||
-- Godot
|
||||
"gdscript",
|
||||
"godot_resource",
|
||||
-- Go
|
||||
"go",
|
||||
"gomod",
|
||||
"gosum",
|
||||
"gowork",
|
||||
-- Web (common)
|
||||
"html",
|
||||
"css",
|
||||
"javascript",
|
||||
"typescript",
|
||||
-- General
|
||||
"lua",
|
||||
"python",
|
||||
"bash",
|
||||
"json",
|
||||
"toml",
|
||||
"yaml",
|
||||
"markdown",
|
||||
"markdown_inline",
|
||||
"vim",
|
||||
"vimdoc",
|
||||
},
|
||||
highlight = { enable = true },
|
||||
indent = { enable = true },
|
||||
})
|
||||
end
|
||||
Loading…
Reference in New Issue