Compare commits
3 commits
b883b4be2c
...
b77289d967
Author | SHA1 | Date | |
---|---|---|---|
|
b77289d967 | ||
fec1213e44 | |||
bbe5d66d1e |
51 changed files with 1639 additions and 607 deletions
53
.gitignore
vendored
53
.gitignore
vendored
|
@ -1,8 +1,45 @@
|
||||||
tt.*
|
# Compiled Lua sources
|
||||||
.tests
|
luac.out
|
||||||
doc/tags
|
|
||||||
debug
|
# luarocks build files
|
||||||
.repro
|
*.src.rock
|
||||||
foo.*
|
*.zip
|
||||||
*.log
|
*.tar.gz
|
||||||
data
|
|
||||||
|
# Object files
|
||||||
|
*.o
|
||||||
|
*.os
|
||||||
|
*.ko
|
||||||
|
*.obj
|
||||||
|
*.elf
|
||||||
|
|
||||||
|
# Precompiled Headers
|
||||||
|
*.gch
|
||||||
|
*.pch
|
||||||
|
|
||||||
|
# Libraries
|
||||||
|
*.lib
|
||||||
|
*.a
|
||||||
|
*.la
|
||||||
|
*.lo
|
||||||
|
*.def
|
||||||
|
*.exp
|
||||||
|
|
||||||
|
# Shared objects (inc. Windows DLLs)
|
||||||
|
*.dll
|
||||||
|
*.so
|
||||||
|
*.so.*
|
||||||
|
*.dylib
|
||||||
|
|
||||||
|
# Executables
|
||||||
|
*.exe
|
||||||
|
*.out
|
||||||
|
*.app
|
||||||
|
*.i*86
|
||||||
|
*.x86_64
|
||||||
|
*.hex
|
||||||
|
|
||||||
|
|
||||||
|
plugin/packer_compiled.lua
|
||||||
|
java-debug/
|
||||||
|
vscode-java-test/
|
|
@ -1,15 +0,0 @@
|
||||||
{
|
|
||||||
"neodev": {
|
|
||||||
"library": {
|
|
||||||
"enabled": true,
|
|
||||||
"plugins": true
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"neoconf": {
|
|
||||||
"plugins": {
|
|
||||||
"lua_ls": {
|
|
||||||
"enabled": true
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1 +0,0 @@
|
||||||
vim.opt_local.conceallevel = 0
|
|
30
init.lua
30
init.lua
|
@ -1,2 +1,28 @@
|
||||||
-- bootstrap lazy.nvim, LazyVim and your plugins
|
-- keep these above
|
||||||
require("config.lazy")
|
require "user.impatient"
|
||||||
|
require "user.options"
|
||||||
|
require "user.keymaps"
|
||||||
|
require "user.plugins"
|
||||||
|
|
||||||
|
--require "user.alpha"
|
||||||
|
require "user.colorscheme"
|
||||||
|
require "user.autocommands"
|
||||||
|
require "user.cmp"
|
||||||
|
require "user.telescope"
|
||||||
|
require "user.gitsigns"
|
||||||
|
require "user.treesitter"
|
||||||
|
--require "user.autopairs"
|
||||||
|
require "user.comment"
|
||||||
|
require "user.nvim-tree"
|
||||||
|
require "user.bufferline"
|
||||||
|
require "user.lualine"
|
||||||
|
require "user.toggleterm"
|
||||||
|
-- require "user.project"
|
||||||
|
require "user.illuminate"
|
||||||
|
require "user.indentline"
|
||||||
|
require "user.lsp"
|
||||||
|
require "user.dap"
|
||||||
|
|
||||||
|
require "user.exrc"
|
||||||
|
require "user.fidget"
|
||||||
|
require "user.whichkey"
|
||||||
|
|
|
@ -1,49 +0,0 @@
|
||||||
{
|
|
||||||
"LazyVim": { "branch": "main", "commit": "7c593dce1f37647fddca3a6b5caaf7a94324a064" },
|
|
||||||
"LuaSnip": { "branch": "master", "commit": "a13af80734eb28f744de6c875330c9d3c24b5f3b" },
|
|
||||||
"bufferline.nvim": { "branch": "main", "commit": "02d795081e6a24ec1fd506c513491543793d0780" },
|
|
||||||
"catppuccin": { "branch": "main", "commit": "233c4175780d9b4e39ae4fe4535c1e4c14bd76ed" },
|
|
||||||
"cmp-buffer": { "branch": "main", "commit": "3022dbc9166796b644a841a02de8dd1cc1d311fa" },
|
|
||||||
"cmp-emoji": { "branch": "main", "commit": "19075c36d5820253d32e2478b6aaf3734aeaafa0" },
|
|
||||||
"cmp-nvim-lsp": { "branch": "main", "commit": "0e6b2ed705ddcff9738ec4ea838141654f12eeef" },
|
|
||||||
"cmp-path": { "branch": "main", "commit": "91ff86cd9c29299a64f968ebb45846c485725f23" },
|
|
||||||
"cmp_luasnip": { "branch": "master", "commit": "18095520391186d634a0045dacaa346291096566" },
|
|
||||||
"fidget.nvim": { "branch": "main", "commit": "0ba1e16d07627532b6cae915cc992ecac249fb97" },
|
|
||||||
"friendly-snippets": { "branch": "main", "commit": "b471f5419155ce832eff71ad8920ea8cfbd54840" },
|
|
||||||
"gitsigns.nvim": { "branch": "main", "commit": "4455bb5364d29ff86639dfd5533d4fe4b48192d4" },
|
|
||||||
"lazy.nvim": { "branch": "main", "commit": "f145e6f42a56306c5536e9efbfe41f7efbec285d" },
|
|
||||||
"leap.nvim": { "branch": "main", "commit": "14b5a65190fe69388a8f59c695ed3394a10d6af8" },
|
|
||||||
"lualine.nvim": { "branch": "master", "commit": "05d78e9fd0cdfb4545974a5aa14b1be95a86e9c9" },
|
|
||||||
"mason-lspconfig.nvim": { "branch": "main", "commit": "5230617372e656d4a2e1e236e03bf7e7b4b97273" },
|
|
||||||
"mason.nvim": { "branch": "main", "commit": "7d7efc738e08fc5bee822857db45cb6103f0b0c1" },
|
|
||||||
"mini.ai": { "branch": "main", "commit": "44d7df1340b16b16b27b67fba07028cb57f45408" },
|
|
||||||
"mini.bufremove": { "branch": "main", "commit": "14805473144fffbd019d07e51bed2d176e065ee9" },
|
|
||||||
"mini.comment": { "branch": "main", "commit": "877acea5b2a32ff55f808fc0ebe9aa898648318c" },
|
|
||||||
"mini.nvim": { "branch": "main", "commit": "296ebbbd3e5ba5e43f5125efe18ad76fe3b632cc" },
|
|
||||||
"mini.surround": { "branch": "main", "commit": "eeaf96562947f75afa51a6266e066529369ca7ef" },
|
|
||||||
"neo-tree.nvim": { "branch": "v2.x", "commit": "d883632bf8f92f1d5abea4a9c28fb2f90aa795aa" },
|
|
||||||
"neoconf.nvim": { "branch": "main", "commit": "4cfa8a11e4de565c95636643db77b44f926f4f25" },
|
|
||||||
"neodev.nvim": { "branch": "main", "commit": "a24a910ad0842be997f34a4811c10b4f92aa53af" },
|
|
||||||
"nui.nvim": { "branch": "main", "commit": "d5a82aae64426a805e19d8ef5a379292f9dc55d3" },
|
|
||||||
"null-ls.nvim": { "branch": "main", "commit": "a138b14099e9623832027ea12b4631ddd2a49256" },
|
|
||||||
"nvim-cmp": { "branch": "main", "commit": "b5a636d46c69bb371995c22d7a10ee1544004879" },
|
|
||||||
"nvim-lspconfig": { "branch": "master", "commit": "0f598b9ab9f2a6d7e137074be99c8d89af44b990" },
|
|
||||||
"nvim-navic": { "branch": "master", "commit": "15704c607569d6c5cfeab486d3ef9459645a70ce" },
|
|
||||||
"nvim-spectre": { "branch": "master", "commit": "1abe23ec9b7bc3082164f4cb842d521ef70e080e" },
|
|
||||||
"nvim-treesitter": { "branch": "master", "commit": "2c59e0ff3da6514b03d853ebecb6c36c515a5d7d" },
|
|
||||||
"nvim-treesitter-textobjects": { "branch": "master", "commit": "2d6d3c7e49a24f6ffbbf7898241fefe9784f61bd" },
|
|
||||||
"nvim-ts-context-commentstring": { "branch": "main", "commit": "0bf8fbc2ca8f8cdb6efbd0a9e32740d7a991e4c3" },
|
|
||||||
"nvim-web-devicons": { "branch": "master", "commit": "2a125024a137677930efcfdf720f205504c97268" },
|
|
||||||
"persistence.nvim": { "branch": "main", "commit": "4b8051c01f696d8849a5cb8afa9767be8db16e40" },
|
|
||||||
"plenary.nvim": { "branch": "master", "commit": "499e0743cf5e8075cd32af68baa3946a1c76adf1" },
|
|
||||||
"telescope.nvim": { "branch": "master", "commit": "991d5db62451ee7a50944b84aaad4b58c3447b60" },
|
|
||||||
"todo-comments.nvim": { "branch": "main", "commit": "09b0b17d824d2d56f02ff15967e8a2499a89c731" },
|
|
||||||
"tokyonight.nvim": { "branch": "main", "commit": "161114bd39b990995e08dbf941f6821afbdcd666" },
|
|
||||||
"trouble.nvim": { "branch": "main", "commit": "2af0dd9767526410c88c628f1cbfcb6cf22dd683" },
|
|
||||||
"typescript.nvim": { "branch": "main", "commit": "5b3680e5c386e8778c081173ea0c978c14a40ccb" },
|
|
||||||
"vim-illuminate": { "branch": "master", "commit": "a2907275a6899c570d16e95b9db5fd921c167502" },
|
|
||||||
"vim-repeat": { "branch": "master", "commit": "24afe922e6a05891756ecf331f39a1f6743d3d5a" },
|
|
||||||
"vim-startuptime": { "branch": "master", "commit": "454b3de856b7bd298700de33d79774ca9b9e3875" },
|
|
||||||
"vim-visual-multi": { "branch": "master", "commit": "724bd53adfbaf32e129b001658b45d4c5c29ca1a" },
|
|
||||||
"which-key.nvim": { "branch": "main", "commit": "e271c28118998c93a14d189af3395812a1aa646c" }
|
|
||||||
}
|
|
|
@ -1,3 +0,0 @@
|
||||||
-- Autocmds are automatically loaded on the VeryLazy event
|
|
||||||
-- Default autocmds that are always set: https://github.com/LazyVim/LazyVim/blob/main/lua/lazyvim/config/autocmds.lua
|
|
||||||
-- Add any additional autocmds here
|
|
|
@ -1,213 +0,0 @@
|
||||||
-- Keymaps are automatically loaded on the VeryLazy event
|
|
||||||
-- Default keymaps that are always set: https://github.com/LazyVim/LazyVim/blob/main/lua/lazyvim/config/keymaps.lua
|
|
||||||
-- Add any additional keymaps here
|
|
||||||
--
|
|
||||||
-- Shorten function name
|
|
||||||
local keymap = vim.keymap.set
|
|
||||||
-- Silent keymap option
|
|
||||||
local opts = { silent = true }
|
|
||||||
|
|
||||||
-- Remap LazyVim
|
|
||||||
keymap("n", "<Leader>l", "<Nop>", opts)
|
|
||||||
keymap("n", "<Leader>lz", "<cmd>:Lazy<cr>", { desc = "Lazy" })
|
|
||||||
|
|
||||||
-- --Remap space as leader key
|
|
||||||
-- keymap("", "<Space>", "<Nop>", opts)
|
|
||||||
-- vim.g.mapleader = " "
|
|
||||||
--
|
|
||||||
-- -- Modes
|
|
||||||
-- -- normal_mode = "n",
|
|
||||||
-- -- insert_mode = "i",
|
|
||||||
-- -- visual_mode = "v",
|
|
||||||
-- -- visual_block_mode = "x",
|
|
||||||
-- -- term_mode = "t",
|
|
||||||
-- -- command_mode = "c",
|
|
||||||
--
|
|
||||||
-- -- Normal --
|
|
||||||
-- -- Better window navigation
|
|
||||||
-- keymap("n", "<C-h>", "<C-w>h", opts)
|
|
||||||
-- keymap("n", "<C-j>", "<C-w>j", opts)
|
|
||||||
-- keymap("n", "<C-k>", "<C-w>k", opts)
|
|
||||||
-- keymap("n", "<C-l>", "<C-w>l", opts)
|
|
||||||
--
|
|
||||||
-- -- Resize with arrows
|
|
||||||
-- keymap("n", "<C-Up>", ":resize -2<CR>", opts)
|
|
||||||
-- keymap("n", "<C-Down>", ":resize +2<CR>", opts)
|
|
||||||
-- keymap("n", "<C-Left>", ":vertical resize -2<CR>", opts)
|
|
||||||
-- keymap("n", "<C-Right>", ":vertical resize +2<CR>", opts)
|
|
||||||
--
|
|
||||||
-- Navigate buffers
|
|
||||||
keymap("n", "<M-l>", ":BufferLineCycleNext<CR>", opts)
|
|
||||||
keymap("n", "<M-h>", ":BufferLineCyclePrev<CR>", opts)
|
|
||||||
keymap("i", "<M-l>", ":BufferLineCycleNext<CR>", opts)
|
|
||||||
keymap("i", "<M-h>", ":BufferLineCyclePrev<CR>", opts)
|
|
||||||
keymap("x", "<M-l>", ":BufferLineCycleNext<CR>", opts)
|
|
||||||
keymap("x", "<M-h>", ":BufferLineCyclePrev<CR>", opts)
|
|
||||||
|
|
||||||
keymap("n", "<H>", "<Nop>", opts)
|
|
||||||
keymap("n", "<L>", "<Nop>", opts)
|
|
||||||
keymap("n", "<M-L>", ":BufferLineMoveNext<CR>", opts)
|
|
||||||
keymap("n", "<M-H>", ":BufferLineMovePrev<CR>", opts)
|
|
||||||
for _, mode in ipairs({ "n", "i", "v" }) do
|
|
||||||
vim.keymap.set(mode, "<A-1>", "<Cmd>BufferLineGoToBuffer 1<CR>", { noremap = true, silent = true })
|
|
||||||
vim.keymap.set(mode, "<A-2>", "<Cmd>BufferLineGoToBuffer 2<CR>", { noremap = true, silent = true })
|
|
||||||
vim.keymap.set(mode, "<A-3>", "<Cmd>BufferLineGoToBuffer 3<CR>", { noremap = true, silent = true })
|
|
||||||
vim.keymap.set(mode, "<A-4>", "<Cmd>BufferLineGoToBuffer 4<CR>", { noremap = true, silent = true })
|
|
||||||
vim.keymap.set(mode, "<A-5>", "<Cmd>BufferLineGoToBuffer 5<CR>", { noremap = true, silent = true })
|
|
||||||
end
|
|
||||||
--
|
|
||||||
--
|
|
||||||
-- -- Clear highlights
|
|
||||||
-- keymap("n", "<leader>h", "<cmd>nohlsearch<CR>", opts)
|
|
||||||
--
|
|
||||||
-- Close buffers
|
|
||||||
keymap("n", "<M-q>", "<cmd>Bdelete<CR>", opts)
|
|
||||||
keymap("n", "<M-Q>", "<cmd>Bdelete!<CR>", opts)
|
|
||||||
--
|
|
||||||
-- -- Better paste
|
|
||||||
-- keymap("x", "p", '"_dP', opts)
|
|
||||||
--
|
|
||||||
-- -- Insert --
|
|
||||||
-- -- Press jk fast to enter
|
|
||||||
-- --keymap("i", "jk", "<ESC>", opts)
|
|
||||||
--
|
|
||||||
-- -- Visual --
|
|
||||||
-- -- Stay in indent mode
|
|
||||||
-- keymap("v", "<", "<gv", opts)
|
|
||||||
-- keymap("v", ">", ">gv", opts)
|
|
||||||
--
|
|
||||||
-- search with '-', for my LatinAmerican layout
|
|
||||||
keymap("n", "-", "/", opts)
|
|
||||||
keymap("x", "-", "/", opts)
|
|
||||||
--
|
|
||||||
-- -- Plugins --
|
|
||||||
--
|
|
||||||
-- NvimTree
|
|
||||||
-- keymap("n", "<leader>e", ":NvimTreeToggle<CR>", opts)
|
|
||||||
--
|
|
||||||
-- -- Telescope
|
|
||||||
-- keymap("n", "<leader>fa", ":Telescope find_files<CR>", opts)
|
|
||||||
-- keymap("n", "<leader>ff", ":Telescope git_files<CR>", opts)
|
|
||||||
-- keymap("n", "<leader>ft", ":Telescope live_grep<CR>", opts)
|
|
||||||
-- keymap("n", "<leader>fp", ":Telescope projects<CR>", opts)
|
|
||||||
-- keymap("n", "<leader>fb", ":Telescope buffers<CR>", opts)
|
|
||||||
-- keymap("n", "<leader>fs", ":Telescope grep_string<CR>", opts)
|
|
||||||
-- keymap("n", "<leader>fr", ":Telescope oldfiles<CR>", opts)
|
|
||||||
--
|
|
||||||
-- -- Git
|
|
||||||
-- --keymap("n", "<leader>gg", "<cmd>lua _LAZYGIT_TOGGLE()<CR>", opts)
|
|
||||||
--
|
|
||||||
-- -- Comment
|
|
||||||
-- keymap("n", "<leader>/", "<cmd>lua require('Comment.api').toggle_current_linewise()<cr>", opts)
|
|
||||||
-- keymap("x", "<leader>/", '<esc><cmd>lua require("Comment.api").toggle_linewise_op(vim.fn.visualmode())<cr>')
|
|
||||||
--
|
|
||||||
-- -- DAP
|
|
||||||
-- keymap("n", "<F9>", "<cmd>lua require'dap'.toggle_breakpoint()<cr>", opts)
|
|
||||||
-- keymap("n", "<F5>", "<cmd>lua require'dap'.continue()<cr>", opts)
|
|
||||||
-- keymap("n", "<F10>", "<cmd>lua require'dap'.step_over()<cr>", opts)
|
|
||||||
-- keymap("n", "<F11>", "<cmd>lua require'dap'.step_into()<cr>", opts)
|
|
||||||
-- keymap("n", "<F23>", "<cmd>lua require'dap'.step_out()<cr>", opts)
|
|
||||||
-- keymap("n", "<leader>dr", "<cmd>lua require'dap'.repl.toggle()<cr>", opts)
|
|
||||||
-- keymap("n", "<leader>dl", "<cmd>lua require'dap'.run_last()<cr>", opts)
|
|
||||||
-- keymap("n", "<leader>du", "<cmd>lua require'dapui'.toggle()<cr>", opts)
|
|
||||||
-- keymap("n", "<F17>", "<cmd>lua require'dap'.terminate()<cr>", opts) -- Shift+F5
|
|
||||||
--
|
|
||||||
-- ---- Vimspector
|
|
||||||
-- --keymap("n", "<F9>", "<Plug>VimspectorToggleBreakpoint", opts)
|
|
||||||
-- --keymap("n", "<F5>", "<plug>VimspectorContinue", opts)
|
|
||||||
-- --keymap("n", "<F10>", "<Plug>VimspectorStepOver", opts)
|
|
||||||
-- --keymap("n", "<F11>", "<Plug>VimspectorStepInto", opts)
|
|
||||||
-- --keymap("n", "<F23>", "<Plug>VimspectorStepOut", opts)
|
|
||||||
-- --keymap("n", "<F17>", "<cmd>VimspectorReset<cr>", opts) -- Shift+F5
|
|
||||||
-- --keymap("n", "<F41>", "<Plug>VimspectorRestart", opts) -- Ctrl+Shift+F5
|
|
||||||
-- --keymap("n", "<leader>di", "<Plug>VimspectorBalloonEval", opts)
|
|
||||||
--
|
|
||||||
-- -- move.nvim
|
|
||||||
-- keymap('n', '<M-J>', ':MoveLine(1)<cr>', opts)
|
|
||||||
-- keymap('n', '<M-K>', ':MoveLine(-1)<cr>', opts)
|
|
||||||
-- keymap('x', '<M-J>', ':MoveBlock(1)<cr>', opts)
|
|
||||||
-- keymap('x', '<M-K>', ':MoveBlock(-1)<cr>', opts)
|
|
||||||
--
|
|
||||||
-- disable arrow keys
|
|
||||||
keymap("n", "<Right>", "<Nop>", opts)
|
|
||||||
keymap("n", "<Left>", "<Nop>", opts)
|
|
||||||
keymap("n", "<Up>", "<Nop>", opts)
|
|
||||||
keymap("n", "<Down>", "<Nop>", opts)
|
|
||||||
keymap("i", "<Right>", "<Nop>", opts)
|
|
||||||
keymap("i", "<Left>", "<Nop>", opts)
|
|
||||||
keymap("i", "<Up>", "<Nop>", opts)
|
|
||||||
keymap("i", "<Down>", "<Nop>", opts)
|
|
||||||
--
|
|
||||||
-- -- move through wrapped lines
|
|
||||||
-- keymap("n", "j", "gj")
|
|
||||||
-- keymap("n", "k", "gk")
|
|
||||||
--
|
|
||||||
-- -- use Alt + ijkl to move in insert mode
|
|
||||||
-- keymap("i", "<M-l>", "<Right>", opts)
|
|
||||||
-- keymap("i", "<M-h>", "<Left>", opts)
|
|
||||||
-- keymap("i", "<M-j>", "<C-o>gj", opts)
|
|
||||||
-- keymap("i", "<M-k>", "<C-o>gk", opts)
|
|
||||||
--
|
|
||||||
-- local function clean_screen()
|
|
||||||
-- vim.o.number = not vim.o.number;
|
|
||||||
-- --if not vim.diagnostic.get_next() then return end
|
|
||||||
-- if vim.o.number then
|
|
||||||
-- vim.diagnostic.show()
|
|
||||||
-- vim.opt.signcolumn = "yes"
|
|
||||||
-- vim.cmd("syntax on")
|
|
||||||
-- else
|
|
||||||
-- vim.diagnostic.hide()
|
|
||||||
-- vim.opt.signcolumn = "no"
|
|
||||||
-- vim.cmd("syntax off")
|
|
||||||
-- end
|
|
||||||
-- end
|
|
||||||
--
|
|
||||||
-- keymap("n", "<leader>n", clean_screen, opts)
|
|
||||||
|
|
||||||
function vim.getVisualSelection()
|
|
||||||
vim.cmd('noau normal! "vy"')
|
|
||||||
local text = vim.fn.getreg('v')
|
|
||||||
vim.fn.setreg('v', {})
|
|
||||||
|
|
||||||
text = string.gsub(text, "\n", "")
|
|
||||||
if #text > 0 then
|
|
||||||
return text
|
|
||||||
else
|
|
||||||
return ''
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
keymap('v', '<space>sw', function()
|
|
||||||
local tb = require('telescope.builtin')
|
|
||||||
local text = vim.getVisualSelection()
|
|
||||||
tb.live_grep({ default_text = text })
|
|
||||||
end, opts)
|
|
||||||
|
|
||||||
--
|
|
||||||
-- local function otherkeymaps()
|
|
||||||
-- local ok
|
|
||||||
-- local wk
|
|
||||||
-- local gs
|
|
||||||
-- ok, wk = pcall(require, "which-key")
|
|
||||||
-- if not ok then
|
|
||||||
-- return
|
|
||||||
-- end
|
|
||||||
-- ok, gs = pcall(require, "gitsigns")
|
|
||||||
-- if not ok then
|
|
||||||
-- return
|
|
||||||
-- end
|
|
||||||
-- wk.register({
|
|
||||||
-- g = {
|
|
||||||
-- name = "gitsigns",
|
|
||||||
-- p = { "<cmd>Gitsigns preview_hunk<cr>", "Preview hunk" },
|
|
||||||
-- b = { function() gs.blame_line{full=false} end, "Blame line (short)" },
|
|
||||||
-- B = { function() gs.blame_line{full=true} end, "Blame line (full)" }
|
|
||||||
-- },
|
|
||||||
-- prefix = "<leader>"
|
|
||||||
-- })
|
|
||||||
-- end
|
|
||||||
-- keymap("n", "<leader>lf", "<cmd>lua vim.lsp.buf.format()<cr>", opts)
|
|
||||||
-- keymap("v", "<leader>lf", "<esc><cmd>'<,'>lua vim.lsp.buf.format{ async = true }<cr>", opts)
|
|
||||||
-- keymap("x", "<leader>lf", "<esc><cmd>'<,'>lua vim.lsp.buf.format{ async = true }<cr>", opts)
|
|
||||||
--
|
|
||||||
-- otherkeymaps()
|
|
|
@ -1,51 +0,0 @@
|
||||||
local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
|
|
||||||
if not vim.loop.fs_stat(lazypath) then
|
|
||||||
-- bootstrap lazy.nvim
|
|
||||||
-- stylua: ignore
|
|
||||||
vim.fn.system({ "git", "clone", "--filter=blob:none", "https://github.com/folke/lazy.nvim.git", "--branch=stable", lazypath })
|
|
||||||
end
|
|
||||||
vim.opt.rtp:prepend(vim.env.LAZY or lazypath)
|
|
||||||
|
|
||||||
require("lazy").setup({
|
|
||||||
spec = {
|
|
||||||
-- add LazyVim and import its plugins
|
|
||||||
{ "LazyVim/LazyVim", import = "lazyvim.plugins" },
|
|
||||||
-- import any extras modules here
|
|
||||||
{ import = "lazyvim.plugins.extras.lang.typescript" },
|
|
||||||
{ import = "lazyvim.plugins.extras.linting.eslint" },
|
|
||||||
{ import = "lazyvim.plugins.extras.formatting.prettier" },
|
|
||||||
-- { import = "lazyvim.plugins.extras.lang.json" },
|
|
||||||
-- { import = "lazyvim.plugins.extras.ui.mini-animate" },
|
|
||||||
-- import/override with your plugins
|
|
||||||
{ import = "plugins" },
|
|
||||||
},
|
|
||||||
defaults = {
|
|
||||||
-- By default, only LazyVim plugins will be lazy-loaded. Your custom plugins will load during startup.
|
|
||||||
-- If you know what you're doing, you can set this to `true` to have all your custom plugins lazy-loaded by default.
|
|
||||||
lazy = false,
|
|
||||||
-- It's recommended to leave version=false for now, since a lot the plugin that support versioning,
|
|
||||||
-- have outdated releases, which may break your Neovim install.
|
|
||||||
version = false, -- always use the latest git commit
|
|
||||||
-- version = "*", -- try installing the latest stable version for plugins that support semver
|
|
||||||
},
|
|
||||||
install = { colorscheme = { "tokyonight", "habamax" } },
|
|
||||||
checker = { enabled = true, notify = false }, -- automatically check for plugin updates
|
|
||||||
change_detection = {
|
|
||||||
notify = false,
|
|
||||||
},
|
|
||||||
performance = {
|
|
||||||
rtp = {
|
|
||||||
-- disable some rtp plugins
|
|
||||||
disabled_plugins = {
|
|
||||||
"gzip",
|
|
||||||
-- "matchit",
|
|
||||||
-- "matchparen",
|
|
||||||
-- "netrwPlugin",
|
|
||||||
"tarPlugin",
|
|
||||||
"tohtml",
|
|
||||||
"tutor",
|
|
||||||
"zipPlugin",
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
})
|
|
|
@ -1,11 +0,0 @@
|
||||||
-- Options are automatically loaded before lazy.nvim startup
|
|
||||||
-- Default options that are always set: https://github.com/LazyVim/LazyVim/blob/main/lua/lazyvim/config/options.lua
|
|
||||||
-- Add any additional options here
|
|
||||||
|
|
||||||
vim.opt.relativenumber = false
|
|
||||||
vim.opt.conceallevel = 0
|
|
||||||
vim.opt.timeoutlen = 1000
|
|
||||||
vim.opt.list = false
|
|
||||||
vim.opt.pumblend = 0
|
|
||||||
vim.opt.tabstop = 4
|
|
||||||
vim.opt.shiftwidth = 4
|
|
|
@ -1,135 +0,0 @@
|
||||||
local cmp = require("cmp")
|
|
||||||
local luasnip = require("luasnip")
|
|
||||||
|
|
||||||
return {
|
|
||||||
{
|
|
||||||
"LazyVim/LazyVim",
|
|
||||||
opts = {
|
|
||||||
colorscheme = "catppuccin",
|
|
||||||
},
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"nvim-lualine/lualine.nvim",
|
|
||||||
opts = {
|
|
||||||
sections = {
|
|
||||||
lualine_z = {},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"nvim-neo-tree/neo-tree.nvim",
|
|
||||||
opts = {
|
|
||||||
window = {
|
|
||||||
mappings = {
|
|
||||||
["l"] = "open",
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"hrsh7th/nvim-cmp",
|
|
||||||
dependencies = {
|
|
||||||
"hrsh7th/cmp-emoji",
|
|
||||||
},
|
|
||||||
opts = function(_, opts)
|
|
||||||
local has_words_before = function()
|
|
||||||
unpack = unpack or table.unpack
|
|
||||||
local line, col = unpack(vim.api.nvim_win_get_cursor(0))
|
|
||||||
return col ~= 0 and vim.api.nvim_buf_get_lines(0, line - 1, line, true)[1]:sub(col, col):match("%s") == nil
|
|
||||||
end
|
|
||||||
|
|
||||||
opts.mapping = vim.tbl_extend("force", opts.mapping, {
|
|
||||||
["<C-k>"] = cmp.mapping.select_prev_item(),
|
|
||||||
["<C-j>"] = cmp.mapping.select_next_item(),
|
|
||||||
-- ["<C-b>"] = cmp.mapping(cmp.mapping.scroll_docs(-1), { "i", "c" }),
|
|
||||||
-- ["<C-f>"] = cmp.mapping(cmp.mapping.scroll_docs(1), { "i", "c" }),
|
|
||||||
["<C-Space>"] = cmp.mapping(cmp.mapping.complete(), { "i", "c" }),
|
|
||||||
-- ["<C-e>"] = cmp.mapping({
|
|
||||||
-- i = cmp.mapping.abort(),
|
|
||||||
-- c = cmp.mapping.close(),
|
|
||||||
-- }),
|
|
||||||
-- Accept currently selected item. If none selected, `select` first item.
|
|
||||||
-- Set `select` to `false` to only confirm explicitly selected items.
|
|
||||||
["<CR>"] = cmp.mapping.confirm({ select = false }),
|
|
||||||
-- ["<Tab>"] = cmp.mapping(function(fallback)
|
|
||||||
-- if cmp.visible() then
|
|
||||||
-- cmp.select_next_item()
|
|
||||||
-- elseif luasnip.expandable() then
|
|
||||||
-- luasnip.expand()
|
|
||||||
-- elseif luasnip.expand_or_jumpable() then
|
|
||||||
-- luasnip.expand_or_jump()
|
|
||||||
-- elseif check_backspace() then
|
|
||||||
-- fallback()
|
|
||||||
-- else
|
|
||||||
-- fallback()
|
|
||||||
-- end
|
|
||||||
-- end, {
|
|
||||||
-- "i",
|
|
||||||
-- "s",
|
|
||||||
-- }),
|
|
||||||
-- ["<S-Tab>"] = cmp.mapping(function(fallback)
|
|
||||||
-- if cmp.visible() then
|
|
||||||
-- cmp.select_prev_item()
|
|
||||||
-- elseif luasnip.jumpable(-1) then
|
|
||||||
-- luasnip.jump(-1)
|
|
||||||
-- else
|
|
||||||
-- fallback()
|
|
||||||
-- end
|
|
||||||
-- end, {
|
|
||||||
-- "i",
|
|
||||||
-- "s",
|
|
||||||
-- }),
|
|
||||||
["<Tab>"] = cmp.mapping(function(fallback)
|
|
||||||
if cmp.visible() then
|
|
||||||
cmp.select_next_item()
|
|
||||||
-- You could replace the expand_or_jumpable() calls with expand_or_locally_jumpable()
|
|
||||||
-- this way you will only jump inside the snippet region
|
|
||||||
elseif luasnip.expand_or_jumpable() then
|
|
||||||
luasnip.expand_or_jump()
|
|
||||||
elseif has_words_before() then
|
|
||||||
cmp.complete()
|
|
||||||
else
|
|
||||||
fallback()
|
|
||||||
end
|
|
||||||
end, { "i", "s" }),
|
|
||||||
["<S-Tab>"] = cmp.mapping(function(fallback)
|
|
||||||
if cmp.visible() then
|
|
||||||
cmp.select_prev_item()
|
|
||||||
elseif luasnip.jumpable(-1) then
|
|
||||||
luasnip.jump(-1)
|
|
||||||
else
|
|
||||||
fallback()
|
|
||||||
end
|
|
||||||
end, { "i", "s" }),
|
|
||||||
})
|
|
||||||
opts.window = {
|
|
||||||
completion = cmp.config.window.bordered(),
|
|
||||||
documentation = cmp.config.window.bordered(),
|
|
||||||
}
|
|
||||||
opts.preselect = cmp.PreselectMode.None
|
|
||||||
opts.completion = {
|
|
||||||
completeopt = "noselect",
|
|
||||||
}
|
|
||||||
|
|
||||||
-- opts.formatting = {
|
|
||||||
-- fields = { "kind", "abbr", "menu" },
|
|
||||||
-- -- format = function(entry, vim_item)
|
|
||||||
-- -- -- vim_item.kind = kind_icons[vim_item.kind]
|
|
||||||
-- -- vim_item.menu = ({
|
|
||||||
-- -- nvim_lsp = "",
|
|
||||||
-- -- nvim_lua = "",
|
|
||||||
-- -- luasnip = "",
|
|
||||||
-- -- buffer = "",
|
|
||||||
-- -- path = "",
|
|
||||||
-- -- emoji = "",
|
|
||||||
-- -- })[entry.source.name]
|
|
||||||
-- -- return vim_item
|
|
||||||
-- -- end,
|
|
||||||
-- }
|
|
||||||
-- opts.confirm_opts = {
|
|
||||||
-- behavior = cmp.ConfirmBehavior.Replace,
|
|
||||||
-- select = false,
|
|
||||||
-- }
|
|
||||||
end,
|
|
||||||
},
|
|
||||||
}
|
|
|
@ -1,12 +0,0 @@
|
||||||
return {
|
|
||||||
{ "echasnovski/mini.nvim", enabled = true },
|
|
||||||
{ "echasnovski/mini.pairs", enabled = false },
|
|
||||||
{ "echasnovski/mini.indentscope", enabled = false },
|
|
||||||
{ "lukas-reineke/indent-blankline.nvim", enabled = false },
|
|
||||||
{ "goolord/alpha-nvim", enabled = false },
|
|
||||||
{ "rcarriga/nvim-notify", enabled = false },
|
|
||||||
{ "ggandor/flit.nvim", enabled = false },
|
|
||||||
{ "stevearc/dressing.nvim", enabled = false },
|
|
||||||
-- { "folke/neodev.nvim", enabled = false },
|
|
||||||
-- { "nvim-neo-tree/neo-tree.nvim", enabled = false },
|
|
||||||
}
|
|
|
@ -1,9 +0,0 @@
|
||||||
return {
|
|
||||||
{
|
|
||||||
"j-hui/fidget.nvim",
|
|
||||||
enabled = true,
|
|
||||||
init = function()
|
|
||||||
require("fidget").setup()
|
|
||||||
end,
|
|
||||||
},
|
|
||||||
}
|
|
|
@ -1,26 +0,0 @@
|
||||||
return {
|
|
||||||
{
|
|
||||||
"neovim/nvim-lspconfig",
|
|
||||||
init = function()
|
|
||||||
local format = function()
|
|
||||||
require("lazyvim.plugins.lsp.format").format({ force = true })
|
|
||||||
end
|
|
||||||
|
|
||||||
local keys = require("lazyvim.plugins.lsp.keymaps").get()
|
|
||||||
keys[#keys + 1] = { "<leader>lf", format, desc = "Format Document", has = "documentFormatting" }
|
|
||||||
keys[#keys + 1] = { "<leader>lf", format, desc = "Format Range", mode = "v", has = "documentRangeFormatting" }
|
|
||||||
end,
|
|
||||||
opts = {
|
|
||||||
autoformat = false,
|
|
||||||
servers = {
|
|
||||||
yamlls = {
|
|
||||||
settings = {
|
|
||||||
yaml = {
|
|
||||||
keyOrdering = false,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
}
|
|
|
@ -1,52 +0,0 @@
|
||||||
return {
|
|
||||||
"folke/noice.nvim",
|
|
||||||
enabled = false,
|
|
||||||
opts = {
|
|
||||||
cmdline = {
|
|
||||||
enabled = true,
|
|
||||||
view = "cmdline",
|
|
||||||
format = {
|
|
||||||
cmdline = false,
|
|
||||||
search_down = false,
|
|
||||||
search_up = false,
|
|
||||||
filter = false,
|
|
||||||
lua = false,
|
|
||||||
help = false,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
messages = {
|
|
||||||
enabled = true,
|
|
||||||
},
|
|
||||||
popupmenu = {
|
|
||||||
enabled = false,
|
|
||||||
backend = "nui",
|
|
||||||
},
|
|
||||||
presets = {
|
|
||||||
bottom_search = true,
|
|
||||||
command_palette = false,
|
|
||||||
long_message_to_split = true,
|
|
||||||
inc_rename = false,
|
|
||||||
lsp_doc_border = true,
|
|
||||||
},
|
|
||||||
lsp = {
|
|
||||||
progress = {
|
|
||||||
enabled = true,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
status = {},
|
|
||||||
-- views = {
|
|
||||||
-- popupmenu = {
|
|
||||||
-- relative = "cursor",
|
|
||||||
-- position = {
|
|
||||||
-- row = 0,
|
|
||||||
-- col = 0,
|
|
||||||
-- },
|
|
||||||
-- },
|
|
||||||
-- },
|
|
||||||
-- routes = {
|
|
||||||
-- view = "cmdline",
|
|
||||||
-- filter = {
|
|
||||||
-- }
|
|
||||||
-- }
|
|
||||||
},
|
|
||||||
}
|
|
|
@ -1,8 +0,0 @@
|
||||||
return {
|
|
||||||
-- {
|
|
||||||
-- "nvim-tree/nvim-tree.lua",
|
|
||||||
-- },
|
|
||||||
-- {
|
|
||||||
-- "nvim-tree/nvim-web-devicons",
|
|
||||||
-- },
|
|
||||||
}
|
|
|
@ -1,9 +0,0 @@
|
||||||
return {
|
|
||||||
{
|
|
||||||
"mg979/vim-visual-multi",
|
|
||||||
-- enabled = true,
|
|
||||||
-- init = function()
|
|
||||||
-- require("fidget").setup()
|
|
||||||
-- end,
|
|
||||||
},
|
|
||||||
}
|
|
35
lua/user/alpha.lua
Normal file
35
lua/user/alpha.lua
Normal file
|
@ -0,0 +1,35 @@
|
||||||
|
local status_ok, alpha = pcall(require, "alpha")
|
||||||
|
if not status_ok then
|
||||||
|
return
|
||||||
|
end
|
||||||
|
|
||||||
|
local dashboard = require "alpha.themes.dashboard"
|
||||||
|
dashboard.section.header.val = {
|
||||||
|
[[ __ ]],
|
||||||
|
[[ ___ ___ ___ __ __ /\_\ ___ ___ ]],
|
||||||
|
[[ / _ `\ / __`\ / __`\/\ \/\ \\/\ \ / __` __`\ ]],
|
||||||
|
[[/\ \/\ \/\ __//\ \_\ \ \ \_/ |\ \ \/\ \/\ \/\ \ ]],
|
||||||
|
[[\ \_\ \_\ \____\ \____/\ \___/ \ \_\ \_\ \_\ \_\]],
|
||||||
|
[[ \/_/\/_/\/____/\/___/ \/__/ \/_/\/_/\/_/\/_/]],
|
||||||
|
}
|
||||||
|
dashboard.section.buttons.val = {
|
||||||
|
dashboard.button("f", " " .. " Find file", ":Telescope find_files <CR>"),
|
||||||
|
dashboard.button("e", " " .. " New file", ":ene <BAR> startinsert <CR>"),
|
||||||
|
dashboard.button("p", " " .. " Find project", ":lua require('telescope').extensions.projects.projects()<CR>"),
|
||||||
|
dashboard.button("r", " " .. " Recent files", ":Telescope oldfiles <CR>"),
|
||||||
|
dashboard.button("t", " " .. " Find text", ":Telescope live_grep <CR>"),
|
||||||
|
dashboard.button("c", " " .. " Config", ":e ~/.config/nvim/init.lua <CR>"),
|
||||||
|
dashboard.button("q", " " .. " Quit", ":qa<CR>"),
|
||||||
|
}
|
||||||
|
local function footer()
|
||||||
|
return "chrisatmachine.com"
|
||||||
|
end
|
||||||
|
|
||||||
|
dashboard.section.footer.val = footer()
|
||||||
|
|
||||||
|
dashboard.section.footer.opts.hl = "Type"
|
||||||
|
dashboard.section.header.opts.hl = "Include"
|
||||||
|
dashboard.section.buttons.opts.hl = "Keyword"
|
||||||
|
|
||||||
|
dashboard.opts.opts.noautocmd = true
|
||||||
|
alpha.setup(dashboard.opts)
|
73
lua/user/autocommands.lua
Normal file
73
lua/user/autocommands.lua
Normal file
|
@ -0,0 +1,73 @@
|
||||||
|
vim.api.nvim_create_autocmd({ "FileType" }, {
|
||||||
|
pattern = { "qf", "help", "man", "lspinfo", "spectre_panel" },
|
||||||
|
callback = function()
|
||||||
|
vim.cmd([[
|
||||||
|
nnoremap <silent> <buffer> q :close<CR>
|
||||||
|
set nobuflisted
|
||||||
|
]])
|
||||||
|
end,
|
||||||
|
})
|
||||||
|
|
||||||
|
vim.api.nvim_create_autocmd({ "FileType" }, {
|
||||||
|
pattern = { "gitcommit"},
|
||||||
|
callback = function()
|
||||||
|
vim.opt_local.wrap = true
|
||||||
|
vim.opt_local.spell = true
|
||||||
|
end,
|
||||||
|
})
|
||||||
|
|
||||||
|
vim.api.nvim_create_autocmd({ "FileType" }, {
|
||||||
|
pattern = { "markdown" },
|
||||||
|
callback = function()
|
||||||
|
vim.opt_local.wrap = true
|
||||||
|
vim.opt_local.spell = true
|
||||||
|
end,
|
||||||
|
})
|
||||||
|
|
||||||
|
vim.cmd("autocmd BufRead,BufNewFile Jenkinsfile set filetype=groovy")
|
||||||
|
|
||||||
|
vim.cmd("autocmd BufEnter * ++nested if winnr('$') == 1 && bufname() == 'NvimTree_' . tabpagenr() | quit | endif")
|
||||||
|
-- vim.api.nvim_create_autocmd({ "BufEnter" }, {
|
||||||
|
-- callback = function()
|
||||||
|
-- vim.cmd [[
|
||||||
|
-- if winnr('$') == 1 && bufname() == 'NvimTree_' . tabpagenr() | quit | endif
|
||||||
|
-- ]]
|
||||||
|
-- end,
|
||||||
|
-- })
|
||||||
|
|
||||||
|
vim.api.nvim_create_autocmd({ "VimResized" }, {
|
||||||
|
callback = function()
|
||||||
|
vim.cmd("tabdo wincmd =")
|
||||||
|
end,
|
||||||
|
})
|
||||||
|
|
||||||
|
vim.api.nvim_create_autocmd({ "CmdWinEnter" }, {
|
||||||
|
callback = function()
|
||||||
|
vim.cmd("quit")
|
||||||
|
end,
|
||||||
|
})
|
||||||
|
vim.api.nvim_create_autocmd({ "BufWinEnter" }, {
|
||||||
|
callback = function()
|
||||||
|
vim.cmd("set formatoptions-=cro")
|
||||||
|
end,
|
||||||
|
})
|
||||||
|
|
||||||
|
vim.api.nvim_create_autocmd({ "TextYankPost" }, {
|
||||||
|
callback = function()
|
||||||
|
vim.highlight.on_yank({ higroup = "Visual", timeout = 200 })
|
||||||
|
end,
|
||||||
|
})
|
||||||
|
|
||||||
|
vim.api.nvim_create_autocmd({ "BufWritePost" }, {
|
||||||
|
pattern = { "*.java" },
|
||||||
|
callback = function()
|
||||||
|
vim.lsp.codelens.refresh()
|
||||||
|
end,
|
||||||
|
})
|
||||||
|
|
||||||
|
vim.api.nvim_create_autocmd({ "VimEnter" }, {
|
||||||
|
callback = function()
|
||||||
|
vim.cmd("hi link illuminatedWord LspReferenceText")
|
||||||
|
vim.cmd("VMTheme sand")
|
||||||
|
end,
|
||||||
|
})
|
34
lua/user/autopairs.lua
Normal file
34
lua/user/autopairs.lua
Normal file
|
@ -0,0 +1,34 @@
|
||||||
|
-- Setup nvim-cmp.
|
||||||
|
local status_ok, npairs = pcall(require, "nvim-autopairs")
|
||||||
|
if not status_ok then
|
||||||
|
return
|
||||||
|
end
|
||||||
|
|
||||||
|
npairs.setup({
|
||||||
|
check_ts = true, -- treesitter integration
|
||||||
|
disable_filetype = { "TelescopePrompt" },
|
||||||
|
ts_config = {
|
||||||
|
lua = { "string", "source" },
|
||||||
|
javascript = { "string", "template_string" },
|
||||||
|
java = false,
|
||||||
|
},
|
||||||
|
|
||||||
|
fast_wrap = {
|
||||||
|
map = "<M-e>",
|
||||||
|
chars = { "{", "[", "(", '"', "'" },
|
||||||
|
pattern = string.gsub([[ [%'%"%)%>%]%)%}%,] ]], "%s+", ""),
|
||||||
|
offset = 0, -- Offset from pattern match
|
||||||
|
end_key = "$",
|
||||||
|
keys = "qwertyuiopzxcvbnmasdfghjkl",
|
||||||
|
check_comma = true,
|
||||||
|
highlight = "PmenuSel",
|
||||||
|
highlight_grey = "LineNr",
|
||||||
|
},
|
||||||
|
})
|
||||||
|
|
||||||
|
local cmp_autopairs = require("nvim-autopairs.completion.cmp")
|
||||||
|
local cmp_status_ok, cmp = pcall(require, "cmp")
|
||||||
|
if not cmp_status_ok then
|
||||||
|
return
|
||||||
|
end
|
||||||
|
cmp.event:on("confirm_done", cmp_autopairs.on_confirm_done({}))
|
104
lua/user/bufferline.lua
Normal file
104
lua/user/bufferline.lua
Normal file
|
@ -0,0 +1,104 @@
|
||||||
|
local status_ok, bufferline = pcall(require, "bufferline")
|
||||||
|
if not status_ok then
|
||||||
|
return
|
||||||
|
end
|
||||||
|
|
||||||
|
bufferline.setup {
|
||||||
|
options = {
|
||||||
|
close_command = "Bdelete! %d", -- can be a string | function, see "Mouse actions"
|
||||||
|
right_mouse_command = "Bdelete! %d", -- can be a string | function, see "Mouse actions"
|
||||||
|
offsets = { { filetype = "NvimTree", text = "", padding = 1 } },
|
||||||
|
separator_style = "thin", -- | "thick" | "thin" | { 'any', 'any' },
|
||||||
|
always_show_bufferline = false
|
||||||
|
},
|
||||||
|
|
||||||
|
highlights = {
|
||||||
|
fill = {
|
||||||
|
fg = { attribute = "fg", highlight = "#ff0000" },
|
||||||
|
bg = { attribute = "bg", highlight = "TabLine" },
|
||||||
|
},
|
||||||
|
|
||||||
|
background = {
|
||||||
|
fg = { attribute = "fg", highlight = "TabLine" },
|
||||||
|
bg = { attribute = "bg", highlight = "TabLine" },
|
||||||
|
},
|
||||||
|
|
||||||
|
buffer_visible = {
|
||||||
|
fg = { attribute = "fg", highlight = "TabLine" },
|
||||||
|
bg = { attribute = "bg", highlight = "TabLine" },
|
||||||
|
},
|
||||||
|
|
||||||
|
close_button = {
|
||||||
|
fg = { attribute = "fg", highlight = "TabLine" },
|
||||||
|
bg = { attribute = "bg", highlight = "TabLine" },
|
||||||
|
},
|
||||||
|
close_button_visible = {
|
||||||
|
fg = { attribute = "fg", highlight = "TabLine" },
|
||||||
|
bg = { attribute = "bg", highlight = "TabLine" },
|
||||||
|
},
|
||||||
|
|
||||||
|
tab_selected = {
|
||||||
|
fg = { attribute = "fg", highlight = "Normal" },
|
||||||
|
bg = { attribute = "bg", highlight = "Normal" },
|
||||||
|
},
|
||||||
|
|
||||||
|
tab = {
|
||||||
|
fg = { attribute = "fg", highlight = "TabLine" },
|
||||||
|
bg = { attribute = "bg", highlight = "TabLine" },
|
||||||
|
},
|
||||||
|
|
||||||
|
tab_close = {
|
||||||
|
-- fg = {attribute='fg',highlight='LspDiagnosticsDefaultError'},
|
||||||
|
fg = { attribute = "fg", highlight = "TabLineSel" },
|
||||||
|
bg = { attribute = "bg", highlight = "Normal" },
|
||||||
|
},
|
||||||
|
|
||||||
|
duplicate_selected = {
|
||||||
|
fg = { attribute = "fg", highlight = "TabLineSel" },
|
||||||
|
bg = { attribute = "bg", highlight = "TabLineSel" },
|
||||||
|
italic = true,
|
||||||
|
},
|
||||||
|
|
||||||
|
duplicate_visible = {
|
||||||
|
fg = { attribute = "fg", highlight = "TabLine" },
|
||||||
|
bg = { attribute = "bg", highlight = "TabLine" },
|
||||||
|
italic = true,
|
||||||
|
},
|
||||||
|
|
||||||
|
duplicate = {
|
||||||
|
fg = { attribute = "fg", highlight = "TabLine" },
|
||||||
|
bg = { attribute = "bg", highlight = "TabLine" },
|
||||||
|
italic = true,
|
||||||
|
},
|
||||||
|
|
||||||
|
modified = {
|
||||||
|
fg = { attribute = "fg", highlight = "TabLine" },
|
||||||
|
bg = { attribute = "bg", highlight = "TabLine" },
|
||||||
|
},
|
||||||
|
|
||||||
|
modified_selected = {
|
||||||
|
fg = { attribute = "fg", highlight = "Normal" },
|
||||||
|
bg = { attribute = "bg", highlight = "Normal" },
|
||||||
|
},
|
||||||
|
|
||||||
|
modified_visible = {
|
||||||
|
fg = { attribute = "fg", highlight = "TabLine" },
|
||||||
|
bg = { attribute = "bg", highlight = "TabLine" },
|
||||||
|
},
|
||||||
|
|
||||||
|
separator = {
|
||||||
|
fg = { attribute = "bg", highlight = "TabLine" },
|
||||||
|
bg = { attribute = "bg", highlight = "TabLine" },
|
||||||
|
},
|
||||||
|
|
||||||
|
separator_selected = {
|
||||||
|
fg = { attribute = "bg", highlight = "Normal" },
|
||||||
|
bg = { attribute = "bg", highlight = "Normal" },
|
||||||
|
},
|
||||||
|
|
||||||
|
indicator_selected = {
|
||||||
|
fg = { attribute = "fg", highlight = "LspDiagnosticsDefaultHint" },
|
||||||
|
bg = { attribute = "bg", highlight = "Normal" },
|
||||||
|
},
|
||||||
|
},
|
||||||
|
}
|
133
lua/user/cmp.lua
Normal file
133
lua/user/cmp.lua
Normal file
|
@ -0,0 +1,133 @@
|
||||||
|
local cmp_status_ok, cmp = pcall(require, "cmp")
|
||||||
|
if not cmp_status_ok then
|
||||||
|
return
|
||||||
|
end
|
||||||
|
|
||||||
|
local snip_status_ok, luasnip = pcall(require, "luasnip")
|
||||||
|
if not snip_status_ok then
|
||||||
|
return
|
||||||
|
end
|
||||||
|
|
||||||
|
require("luasnip/loaders/from_vscode").lazy_load()
|
||||||
|
|
||||||
|
local check_backspace = function()
|
||||||
|
local col = vim.fn.col(".") - 1
|
||||||
|
return col == 0 or vim.fn.getline("."):sub(col, col):match("%s")
|
||||||
|
end
|
||||||
|
|
||||||
|
local kind_icons = {
|
||||||
|
Text = "",
|
||||||
|
Method = "",
|
||||||
|
Function = "",
|
||||||
|
Constructor = "",
|
||||||
|
Field = "",
|
||||||
|
Variable = "",
|
||||||
|
Class = "",
|
||||||
|
Interface = "",
|
||||||
|
Module = "",
|
||||||
|
Property = "",
|
||||||
|
Unit = "",
|
||||||
|
Value = "",
|
||||||
|
Enum = "",
|
||||||
|
Keyword = "",
|
||||||
|
Snippet = "",
|
||||||
|
Color = "",
|
||||||
|
File = "",
|
||||||
|
Reference = "",
|
||||||
|
Folder = "",
|
||||||
|
EnumMember = "",
|
||||||
|
Constant = "",
|
||||||
|
Struct = "",
|
||||||
|
Event = "",
|
||||||
|
Operator = "",
|
||||||
|
TypeParameter = "",
|
||||||
|
}
|
||||||
|
|
||||||
|
luasnip.config.setup({
|
||||||
|
region_check_events = "CursorHold,InsertLeave,InsertEnter"
|
||||||
|
})
|
||||||
|
|
||||||
|
cmp.setup({
|
||||||
|
snippet = {
|
||||||
|
expand = function(args)
|
||||||
|
luasnip.lsp_expand(args.body) -- For `luasnip` users.
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
|
||||||
|
mapping = cmp.mapping.preset.insert({
|
||||||
|
["<C-k>"] = cmp.mapping.select_prev_item(),
|
||||||
|
["<C-j>"] = cmp.mapping.select_next_item(),
|
||||||
|
["<C-b>"] = cmp.mapping(cmp.mapping.scroll_docs(-1), { "i", "c" }),
|
||||||
|
["<C-f>"] = cmp.mapping(cmp.mapping.scroll_docs(1), { "i", "c" }),
|
||||||
|
["<C-Space>"] = cmp.mapping(cmp.mapping.complete(), { "i", "c" }),
|
||||||
|
["<C-e>"] = cmp.mapping({
|
||||||
|
i = cmp.mapping.abort(),
|
||||||
|
c = cmp.mapping.close(),
|
||||||
|
}),
|
||||||
|
-- Accept currently selected item. If none selected, `select` first item.
|
||||||
|
-- Set `select` to `false` to only confirm explicitly selected items.
|
||||||
|
["<CR>"] = cmp.mapping.confirm({ select = false }),
|
||||||
|
["<Tab>"] = cmp.mapping(function(fallback)
|
||||||
|
if cmp.visible() then
|
||||||
|
cmp.select_next_item()
|
||||||
|
elseif luasnip.expandable() then
|
||||||
|
luasnip.expand()
|
||||||
|
elseif luasnip.expand_or_jumpable() then
|
||||||
|
luasnip.expand_or_jump()
|
||||||
|
elseif check_backspace() then
|
||||||
|
fallback()
|
||||||
|
else
|
||||||
|
fallback()
|
||||||
|
end
|
||||||
|
end, {
|
||||||
|
"i",
|
||||||
|
"s",
|
||||||
|
}),
|
||||||
|
["<S-Tab>"] = cmp.mapping(function(fallback)
|
||||||
|
if cmp.visible() then
|
||||||
|
cmp.select_prev_item()
|
||||||
|
elseif luasnip.jumpable(-1) then
|
||||||
|
luasnip.jump(-1)
|
||||||
|
else
|
||||||
|
fallback()
|
||||||
|
end
|
||||||
|
end, {
|
||||||
|
"i",
|
||||||
|
"s",
|
||||||
|
}),
|
||||||
|
}),
|
||||||
|
formatting = {
|
||||||
|
fields = { "kind", "abbr", "menu" },
|
||||||
|
format = function(entry, vim_item)
|
||||||
|
vim_item.kind = kind_icons[vim_item.kind]
|
||||||
|
vim_item.menu = ({
|
||||||
|
nvim_lsp = "",
|
||||||
|
nvim_lua = "",
|
||||||
|
luasnip = "",
|
||||||
|
buffer = "",
|
||||||
|
path = "",
|
||||||
|
emoji = "",
|
||||||
|
})[entry.source.name]
|
||||||
|
return vim_item
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
sources = {
|
||||||
|
{ name = "nvim_lsp" },
|
||||||
|
{ name = "nvim_lua" },
|
||||||
|
{ name = "luasnip" },
|
||||||
|
{ name = "buffer" },
|
||||||
|
{ name = "path" },
|
||||||
|
{ name = "nvim_lsp_signature_help" },
|
||||||
|
},
|
||||||
|
confirm_opts = {
|
||||||
|
behavior = cmp.ConfirmBehavior.Replace,
|
||||||
|
select = false,
|
||||||
|
},
|
||||||
|
window = {
|
||||||
|
completion = cmp.config.window.bordered(),
|
||||||
|
documentation = cmp.config.window.bordered(),
|
||||||
|
},
|
||||||
|
experimental = {
|
||||||
|
ghost_text = true,
|
||||||
|
},
|
||||||
|
})
|
31
lua/user/colorscheme.lua
Normal file
31
lua/user/colorscheme.lua
Normal file
|
@ -0,0 +1,31 @@
|
||||||
|
--vim.cmd [[colorscheme catppuccin]]
|
||||||
|
|
||||||
|
--TokyonNight
|
||||||
|
--local colorscheme = "tokyonight-night"
|
||||||
|
|
||||||
|
--Catppuccin
|
||||||
|
vim.g.catppuccin_flavour = "mocha" -- latte, frappe, macchiato, mocha
|
||||||
|
local colorscheme = "catppuccin"
|
||||||
|
require("catppuccin").setup({
|
||||||
|
-- integrations = {
|
||||||
|
-- treesitter_context = true,
|
||||||
|
-- fidget = false,
|
||||||
|
-- },
|
||||||
|
custom_highlights = function(colors)
|
||||||
|
return {
|
||||||
|
TreesitterContext = { bg = colors.surface0 },
|
||||||
|
TreesitterContextLineNumber = { bg = colors.surface0 },
|
||||||
|
-- TreesitterContextBottom = { style = { "underline" } },
|
||||||
|
MultiCursor = { bg = colors.red },
|
||||||
|
VM_Cursor = { bg = colors.red },
|
||||||
|
}
|
||||||
|
end
|
||||||
|
})
|
||||||
|
|
||||||
|
--DarkPlus
|
||||||
|
--local colorscheme = "darkplus"
|
||||||
|
|
||||||
|
local status_ok, _ = pcall(vim.cmd, "colorscheme " .. colorscheme)
|
||||||
|
if not status_ok then
|
||||||
|
return
|
||||||
|
end
|
29
lua/user/comment.lua
Normal file
29
lua/user/comment.lua
Normal file
|
@ -0,0 +1,29 @@
|
||||||
|
local status_ok, comment = pcall(require, "Comment")
|
||||||
|
if not status_ok then
|
||||||
|
return
|
||||||
|
end
|
||||||
|
|
||||||
|
comment.setup({
|
||||||
|
pre_hook = function(ctx)
|
||||||
|
-- Only calculate commentstring for tsx filetypes
|
||||||
|
if vim.bo.filetype == "typescriptreact" then
|
||||||
|
local U = require("Comment.utils")
|
||||||
|
|
||||||
|
-- Determine whether to use linewise or blockwise commentstring
|
||||||
|
local type = ctx.ctype == U.ctype.linewise and "__default" or "__multiline"
|
||||||
|
|
||||||
|
-- Determine the location where to calculate commentstring from
|
||||||
|
local location = nil
|
||||||
|
if ctx.ctype == U.ctype.blockwise then
|
||||||
|
location = require("ts_context_commentstring.utils").get_cursor_location()
|
||||||
|
elseif ctx.cmotion == U.cmotion.v or ctx.cmotion == U.cmotion.V then
|
||||||
|
location = require("ts_context_commentstring.utils").get_visual_start_location()
|
||||||
|
end
|
||||||
|
|
||||||
|
return require("ts_context_commentstring.internal").calculate_commentstring({
|
||||||
|
key = type,
|
||||||
|
location = location,
|
||||||
|
})
|
||||||
|
end
|
||||||
|
end,
|
||||||
|
})
|
65
lua/user/dap.lua
Normal file
65
lua/user/dap.lua
Normal file
|
@ -0,0 +1,65 @@
|
||||||
|
local dap_status_ok, dap = pcall(require, "dap")
|
||||||
|
if not dap_status_ok then
|
||||||
|
return
|
||||||
|
end
|
||||||
|
|
||||||
|
local dap_ui_status_ok, dapui = pcall(require, "dapui")
|
||||||
|
if not dap_ui_status_ok then
|
||||||
|
return
|
||||||
|
end
|
||||||
|
|
||||||
|
local dap_install_status_ok, dap_install = pcall(require, "dap-install")
|
||||||
|
if not dap_install_status_ok then
|
||||||
|
return
|
||||||
|
end
|
||||||
|
|
||||||
|
dap_install.setup {}
|
||||||
|
|
||||||
|
dap_install.config("python", {})
|
||||||
|
dap_install.config("codelldb", {})
|
||||||
|
-- add other configs here
|
||||||
|
|
||||||
|
dapui.setup()
|
||||||
|
--dapui.setup {
|
||||||
|
-- sidebar = {
|
||||||
|
-- elements = {
|
||||||
|
-- {
|
||||||
|
-- id = "scopes",
|
||||||
|
-- size = 0.25, -- Can be float or integer > 1
|
||||||
|
-- },
|
||||||
|
-- { id = "breakpoints", size = 0.25 },
|
||||||
|
-- },
|
||||||
|
-- size = 40,
|
||||||
|
-- position = "right", -- Can be "left", "right", "top", "bottom"
|
||||||
|
-- },
|
||||||
|
-- tray = {
|
||||||
|
-- elements = {},
|
||||||
|
-- },
|
||||||
|
--}
|
||||||
|
|
||||||
|
vim.fn.sign_define("DapBreakpoint", { text = "●", texthl = "DiagnosticSignError", linehl = "", numhl = "" })
|
||||||
|
|
||||||
|
dap.listeners.after.event_initialized["dapui_config"] = function()
|
||||||
|
dapui.open()
|
||||||
|
end
|
||||||
|
|
||||||
|
dap.listeners.before.event_terminated["dapui_config"] = function()
|
||||||
|
dapui.close()
|
||||||
|
end
|
||||||
|
|
||||||
|
dap.listeners.before.event_exited["dapui_config"] = function()
|
||||||
|
dapui.close()
|
||||||
|
end
|
||||||
|
|
||||||
|
-- local codelldb_path = "/usr/lib/codelldb/adapter/codelldb"
|
||||||
|
-- local liblldb_path = "/usr/lib/codelldb/adapter/libcodelldb.so"
|
||||||
|
--
|
||||||
|
-- dap.adapters.codelldb = {
|
||||||
|
-- type = 'server',
|
||||||
|
-- host = '127.0.0.1',
|
||||||
|
-- port = "13000",
|
||||||
|
-- executable = {
|
||||||
|
-- command = codelldb_path,
|
||||||
|
-- args = {"--liblldb", liblldb_path, "--port", "13000", "--params", "{\"showDisassembly\": \"never\"}"},
|
||||||
|
-- }
|
||||||
|
-- }
|
9
lua/user/exrc.lua
Normal file
9
lua/user/exrc.lua
Normal file
|
@ -0,0 +1,9 @@
|
||||||
|
-- Setup exrc
|
||||||
|
local status_ok, exrc = pcall(require, "exrc")
|
||||||
|
if not status_ok then
|
||||||
|
return
|
||||||
|
end
|
||||||
|
|
||||||
|
exrc.setup({
|
||||||
|
files = { ".nvimrc.lua" }
|
||||||
|
})
|
6
lua/user/fidget.lua
Normal file
6
lua/user/fidget.lua
Normal file
|
@ -0,0 +1,6 @@
|
||||||
|
local ok, fidget = pcall(require, "fidget")
|
||||||
|
if not ok then
|
||||||
|
return
|
||||||
|
end
|
||||||
|
|
||||||
|
fidget.setup()
|
43
lua/user/gitsigns.lua
Normal file
43
lua/user/gitsigns.lua
Normal file
|
@ -0,0 +1,43 @@
|
||||||
|
local status_ok, gitsigns = pcall(require, "gitsigns")
|
||||||
|
if not status_ok then
|
||||||
|
return
|
||||||
|
end
|
||||||
|
|
||||||
|
gitsigns.setup {
|
||||||
|
signs = {
|
||||||
|
add = { hl = "GitSignsAdd", text = "▎", numhl = "GitSignsAddNr", linehl = "GitSignsAddLn" },
|
||||||
|
change = { hl = "GitSignsChange", text = "▎", numhl = "GitSignsChangeNr", linehl = "GitSignsChangeLn" },
|
||||||
|
delete = { hl = "GitSignsDelete", text = "契", numhl = "GitSignsDeleteNr", linehl = "GitSignsDeleteLn" },
|
||||||
|
topdelete = { hl = "GitSignsDelete", text = "契", numhl = "GitSignsDeleteNr", linehl = "GitSignsDeleteLn" },
|
||||||
|
changedelete = { hl = "GitSignsChange", text = "▎", numhl = "GitSignsChangeNr", linehl = "GitSignsChangeLn" },
|
||||||
|
},
|
||||||
|
signcolumn = true, -- Toggle with `:Gitsigns toggle_signs`
|
||||||
|
watch_gitdir = {
|
||||||
|
interval = 1000,
|
||||||
|
follow_files = true,
|
||||||
|
},
|
||||||
|
attach_to_untracked = true,
|
||||||
|
current_line_blame_opts = {
|
||||||
|
virt_text = true,
|
||||||
|
virt_text_pos = "eol", -- 'eol' | 'overlay' | 'right_align'
|
||||||
|
delay = 1000,
|
||||||
|
},
|
||||||
|
sign_priority = 6,
|
||||||
|
update_debounce = 100,
|
||||||
|
status_formatter = nil, -- Use default
|
||||||
|
preview_config = {
|
||||||
|
-- Options passed to nvim_open_win
|
||||||
|
border = "single",
|
||||||
|
style = "minimal",
|
||||||
|
relative = "cursor",
|
||||||
|
row = 0,
|
||||||
|
col = 1,
|
||||||
|
},
|
||||||
|
-- on_attach = function (bufnr)
|
||||||
|
-- local gs = package.loaded.gitsigns
|
||||||
|
-- local opts = { buffer=bufnr, silent=true }
|
||||||
|
-- vim.keymap.set('n', '<Leader>hp', gs.preview_hunk, opts)
|
||||||
|
-- vim.keymap.set('n', '<Leader>hb', function() gs.blame_line{full=false} end, opts)
|
||||||
|
-- vim.keymap.set('n', '<Leader>hB', function() gs.blame_line{full=true} end, opts)
|
||||||
|
-- end
|
||||||
|
}
|
38
lua/user/illuminate.lua
Normal file
38
lua/user/illuminate.lua
Normal file
|
@ -0,0 +1,38 @@
|
||||||
|
local status_ok, illuminate = pcall(require, "illuminate")
|
||||||
|
if not status_ok then
|
||||||
|
return
|
||||||
|
end
|
||||||
|
|
||||||
|
vim.g.Illuminate_ftblacklist = {'alpha', 'NvimTree'}
|
||||||
|
vim.api.nvim_set_keymap('n', '<a-n>', '<cmd>lua require"illuminate".next_reference{wrap=true}<cr>', {noremap=true})
|
||||||
|
vim.api.nvim_set_keymap('n', '<a-p>', '<cmd>lua require"illuminate".next_reference{reverse=true,wrap=true}<cr>', {noremap=true})
|
||||||
|
|
||||||
|
illuminate.configure {
|
||||||
|
providers = {
|
||||||
|
"lsp",
|
||||||
|
"treesitter",
|
||||||
|
"regex",
|
||||||
|
},
|
||||||
|
delay = 200,
|
||||||
|
filetypes_denylist = {
|
||||||
|
"dirvish",
|
||||||
|
"fugitive",
|
||||||
|
"alpha",
|
||||||
|
"NvimTree",
|
||||||
|
"packer",
|
||||||
|
"neogitstatus",
|
||||||
|
"Trouble",
|
||||||
|
"lir",
|
||||||
|
"Outline",
|
||||||
|
"spectre_panel",
|
||||||
|
"toggleterm",
|
||||||
|
"DressingSelect",
|
||||||
|
"TelescopePrompt",
|
||||||
|
},
|
||||||
|
filetypes_allowlist = {},
|
||||||
|
modes_denylist = {},
|
||||||
|
modes_allowlist = {},
|
||||||
|
providers_regex_syntax_denylist = {},
|
||||||
|
providers_regex_syntax_allowlist = {},
|
||||||
|
under_cursor = true,
|
||||||
|
}
|
6
lua/user/impatient.lua
Normal file
6
lua/user/impatient.lua
Normal file
|
@ -0,0 +1,6 @@
|
||||||
|
local status_ok, impatient = pcall(require, "impatient")
|
||||||
|
if not status_ok then
|
||||||
|
return
|
||||||
|
end
|
||||||
|
|
||||||
|
impatient.enable_profile()
|
19
lua/user/indentline.lua
Normal file
19
lua/user/indentline.lua
Normal file
|
@ -0,0 +1,19 @@
|
||||||
|
local enabled = true
|
||||||
|
local status_ok, indent_blankline = pcall(require, "indent_blankline")
|
||||||
|
if (not enabled) or (not status_ok) then
|
||||||
|
return
|
||||||
|
end
|
||||||
|
|
||||||
|
indent_blankline.setup {
|
||||||
|
char = "▏",
|
||||||
|
show_trailing_blankline_indent = false,
|
||||||
|
show_first_indent_level = true,
|
||||||
|
use_treesitter = true,
|
||||||
|
show_current_context = true,
|
||||||
|
buftype_exclude = { "terminal", "nofile" },
|
||||||
|
filetype_exclude = {
|
||||||
|
"help",
|
||||||
|
"packer",
|
||||||
|
"NvimTree",
|
||||||
|
},
|
||||||
|
}
|
200
lua/user/keymaps.lua
Normal file
200
lua/user/keymaps.lua
Normal file
|
@ -0,0 +1,200 @@
|
||||||
|
-- Shorten function name
|
||||||
|
local keymap = vim.keymap.set
|
||||||
|
-- Silent keymap option
|
||||||
|
local opts = { silent = true }
|
||||||
|
|
||||||
|
--Remap space as leader key
|
||||||
|
keymap("", "<Space>", "<Nop>", opts)
|
||||||
|
vim.g.mapleader = " "
|
||||||
|
|
||||||
|
-- Modes
|
||||||
|
-- normal_mode = "n",
|
||||||
|
-- insert_mode = "i",
|
||||||
|
-- visual_mode = "v",
|
||||||
|
-- visual_block_mode = "x",
|
||||||
|
-- term_mode = "t",
|
||||||
|
-- command_mode = "c",
|
||||||
|
|
||||||
|
-- Normal --
|
||||||
|
-- Better window navigation
|
||||||
|
keymap("n", "<C-h>", "<C-w>h", opts)
|
||||||
|
keymap("n", "<C-j>", "<C-w>j", opts)
|
||||||
|
keymap("n", "<C-k>", "<C-w>k", opts)
|
||||||
|
keymap("n", "<C-l>", "<C-w>l", opts)
|
||||||
|
|
||||||
|
-- Resize with arrows
|
||||||
|
keymap("n", "<C-Up>", ":resize -2<CR>", opts)
|
||||||
|
keymap("n", "<C-Down>", ":resize +2<CR>", opts)
|
||||||
|
keymap("n", "<C-Left>", ":vertical resize -2<CR>", opts)
|
||||||
|
keymap("n", "<C-Right>", ":vertical resize +2<CR>", opts)
|
||||||
|
|
||||||
|
-- Navigate buffers
|
||||||
|
keymap("n", "<M-l>", ":BufferLineCycleNext<CR>", opts)
|
||||||
|
keymap("n", "<M-h>", ":BufferLineCyclePrev<CR>", opts)
|
||||||
|
keymap("n", "H", "<Nop>", opts)
|
||||||
|
keymap("n", "L", "<Nop>", opts)
|
||||||
|
keymap("n", "<M-L>", ":BufferLineMoveNext<CR>", opts)
|
||||||
|
keymap("n", "<M-H>", ":BufferLineMovePrev<CR>", opts)
|
||||||
|
for _, mode in ipairs({"n", "i", "v"}) do
|
||||||
|
vim.keymap.set(mode, '<A-1>', "<Cmd>BufferLineGoToBuffer 1<CR>", { noremap = true, silent = true })
|
||||||
|
vim.keymap.set(mode, '<A-2>', "<Cmd>BufferLineGoToBuffer 2<CR>", { noremap = true, silent = true })
|
||||||
|
vim.keymap.set(mode, '<A-3>', "<Cmd>BufferLineGoToBuffer 3<CR>", { noremap = true, silent = true })
|
||||||
|
vim.keymap.set(mode, '<A-4>', "<Cmd>BufferLineGoToBuffer 4<CR>", { noremap = true, silent = true })
|
||||||
|
vim.keymap.set(mode, '<A-5>', "<Cmd>BufferLineGoToBuffer 5<CR>", { noremap = true, silent = true })
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
|
-- Clear highlights
|
||||||
|
keymap("n", "<leader>h", "<cmd>nohlsearch<CR>", opts)
|
||||||
|
|
||||||
|
-- Close buffers
|
||||||
|
keymap("n", "<M-q>", "<cmd>Bdelete<CR>", opts)
|
||||||
|
keymap("n", "<M-Q>", "<cmd>Bdelete!<CR>", opts)
|
||||||
|
|
||||||
|
-- Better paste
|
||||||
|
keymap("x", "p", '"_dP', opts)
|
||||||
|
|
||||||
|
-- Insert --
|
||||||
|
-- Press jk fast to enter
|
||||||
|
--keymap("i", "jk", "<ESC>", opts)
|
||||||
|
|
||||||
|
-- Visual --
|
||||||
|
-- Stay in indent mode
|
||||||
|
keymap("v", "<", "<gv", opts)
|
||||||
|
keymap("v", ">", ">gv", opts)
|
||||||
|
|
||||||
|
-- search with '-', for my LatinAmerican layour
|
||||||
|
keymap("n", "-", "/", opts)
|
||||||
|
keymap("x", "-", "/", opts)
|
||||||
|
|
||||||
|
-- Plugins --
|
||||||
|
|
||||||
|
-- NvimTree
|
||||||
|
keymap("n", "<leader>e", ":NvimTreeToggle<CR>", opts)
|
||||||
|
|
||||||
|
-- Telescope
|
||||||
|
keymap("n", "<leader>fa", ":Telescope find_files<CR>", opts)
|
||||||
|
keymap("n", "<leader>ff", ":Telescope git_files<CR>", opts)
|
||||||
|
keymap("n", "<leader>ft", ":Telescope live_grep<CR>", opts)
|
||||||
|
keymap("n", "<leader>fp", ":Telescope projects<CR>", opts)
|
||||||
|
keymap("n", "<leader>fb", ":Telescope buffers<CR>", opts)
|
||||||
|
-- keymap("n", "<leader>fs", ":Telescope grep_string<CR>", opts)
|
||||||
|
keymap("n", "<leader>fr", ":Telescope oldfiles<CR>", opts)
|
||||||
|
|
||||||
|
function vim.getVisualSelection()
|
||||||
|
vim.cmd('noau normal! "vy"')
|
||||||
|
local text = vim.fn.getreg('v')
|
||||||
|
vim.fn.setreg('v', {})
|
||||||
|
|
||||||
|
text = string.gsub(text, "\n", "")
|
||||||
|
if #text > 0 then
|
||||||
|
return text
|
||||||
|
else
|
||||||
|
return ''
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
-- keymap('n', '<space>fs', ':Telescope current_buffer_fuzzy_find<cr>', opts)
|
||||||
|
-- keymap('v', '<space>fs', function()
|
||||||
|
-- local tb = require('telescope.builtin')
|
||||||
|
-- local text = vim.getVisualSelection()
|
||||||
|
-- tb.current_buffer_fuzzy_find({ default_text = text })
|
||||||
|
-- end, opts)
|
||||||
|
|
||||||
|
keymap('n', '<space>fs', ':Telescope grep_string<cr>', opts)
|
||||||
|
keymap('v', '<space>fs', function()
|
||||||
|
local tb = require('telescope.builtin')
|
||||||
|
local text = vim.getVisualSelection()
|
||||||
|
tb.live_grep({ default_text = text })
|
||||||
|
end, opts)
|
||||||
|
|
||||||
|
-- Git
|
||||||
|
--keymap("n", "<leader>gg", "<cmd>lua _LAZYGIT_TOGGLE()<CR>", opts)
|
||||||
|
|
||||||
|
-- Comment
|
||||||
|
keymap("n", "<leader>/", "<cmd>lua require('Comment.api').toggle_current_linewise()<cr>", opts)
|
||||||
|
keymap("x", "<leader>/", '<esc><cmd>lua require("Comment.api").toggle_linewise_op(vim.fn.visualmode())<cr>')
|
||||||
|
|
||||||
|
-- DAP
|
||||||
|
keymap("n", "<F9>", "<cmd>lua require'dap'.toggle_breakpoint()<cr>", opts)
|
||||||
|
keymap("n", "<F5>", "<cmd>lua require'dap'.continue()<cr>", opts)
|
||||||
|
keymap("n", "<F10>", "<cmd>lua require'dap'.step_over()<cr>", opts)
|
||||||
|
keymap("n", "<F11>", "<cmd>lua require'dap'.step_into()<cr>", opts)
|
||||||
|
keymap("n", "<F23>", "<cmd>lua require'dap'.step_out()<cr>", opts)
|
||||||
|
keymap("n", "<leader>dr", "<cmd>lua require'dap'.repl.toggle()<cr>", opts)
|
||||||
|
keymap("n", "<leader>dl", "<cmd>lua require'dap'.run_last()<cr>", opts)
|
||||||
|
keymap("n", "<leader>du", "<cmd>lua require'dapui'.toggle()<cr>", opts)
|
||||||
|
keymap("n", "<F17>", "<cmd>lua require'dap'.terminate()<cr>", opts) -- Shift+F5
|
||||||
|
|
||||||
|
---- Vimspector
|
||||||
|
--keymap("n", "<F9>", "<Plug>VimspectorToggleBreakpoint", opts)
|
||||||
|
--keymap("n", "<F5>", "<plug>VimspectorContinue", opts)
|
||||||
|
--keymap("n", "<F10>", "<Plug>VimspectorStepOver", opts)
|
||||||
|
--keymap("n", "<F11>", "<Plug>VimspectorStepInto", opts)
|
||||||
|
--keymap("n", "<F23>", "<Plug>VimspectorStepOut", opts)
|
||||||
|
--keymap("n", "<F17>", "<cmd>VimspectorReset<cr>", opts) -- Shift+F5
|
||||||
|
--keymap("n", "<F41>", "<Plug>VimspectorRestart", opts) -- Ctrl+Shift+F5
|
||||||
|
--keymap("n", "<leader>di", "<Plug>VimspectorBalloonEval", opts)
|
||||||
|
|
||||||
|
-- move.nvim
|
||||||
|
keymap('n', '<M-J>', ':MoveLine(1)<cr>', opts)
|
||||||
|
keymap('n', '<M-K>', ':MoveLine(-1)<cr>', opts)
|
||||||
|
keymap('x', '<M-J>', ':MoveBlock(1)<cr>', opts)
|
||||||
|
keymap('x', '<M-K>', ':MoveBlock(-1)<cr>', opts)
|
||||||
|
|
||||||
|
-- disable arrow keys
|
||||||
|
keymap("n", "<Right>", "<Nop>", opts)
|
||||||
|
keymap("n", "<Left>", "<Nop>", opts)
|
||||||
|
keymap("n", "<Up>", "<Nop>", opts)
|
||||||
|
keymap("n", "<Down>", "<Nop>", opts)
|
||||||
|
keymap("i", "<Right>", "<Nop>", opts)
|
||||||
|
keymap("i", "<Left>", "<Nop>", opts)
|
||||||
|
keymap("i", "<Up>", "<Nop>", opts)
|
||||||
|
keymap("i", "<Down>", "<Nop>", opts)
|
||||||
|
|
||||||
|
-- move through wrapped lines
|
||||||
|
keymap("n", "j", "gj")
|
||||||
|
keymap("n", "k", "gk")
|
||||||
|
|
||||||
|
local function clean_screen()
|
||||||
|
vim.o.number = not vim.o.number;
|
||||||
|
--if not vim.diagnostic.get_next() then return end
|
||||||
|
if vim.o.number then
|
||||||
|
vim.diagnostic.show()
|
||||||
|
vim.opt.signcolumn = "yes"
|
||||||
|
vim.cmd("syntax on")
|
||||||
|
else
|
||||||
|
vim.diagnostic.hide()
|
||||||
|
vim.opt.signcolumn = "no"
|
||||||
|
vim.cmd("syntax off")
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
keymap("n", "<leader>n", clean_screen, opts)
|
||||||
|
|
||||||
|
local function otherkeymaps()
|
||||||
|
local ok
|
||||||
|
local wk
|
||||||
|
local gs
|
||||||
|
ok, wk = pcall(require, "which-key")
|
||||||
|
if not ok then
|
||||||
|
return
|
||||||
|
end
|
||||||
|
ok, gs = pcall(require, "gitsigns")
|
||||||
|
if not ok then
|
||||||
|
return
|
||||||
|
end
|
||||||
|
wk.register({
|
||||||
|
g = {
|
||||||
|
name = "gitsigns",
|
||||||
|
p = { "<cmd>Gitsigns preview_hunk<cr>", "Preview hunk" },
|
||||||
|
b = { function() gs.blame_line{full=false} end, "Blame line (short)" },
|
||||||
|
B = { function() gs.blame_line{full=true} end, "Blame line (full)" }
|
||||||
|
},
|
||||||
|
prefix = "<leader>"
|
||||||
|
})
|
||||||
|
end
|
||||||
|
|
||||||
|
otherkeymaps()
|
99
lua/user/lsp/handlers.lua
Normal file
99
lua/user/lsp/handlers.lua
Normal file
|
@ -0,0 +1,99 @@
|
||||||
|
local M = {}
|
||||||
|
|
||||||
|
local status_cmp_ok, cmp_nvim_lsp = pcall(require, "cmp_nvim_lsp")
|
||||||
|
if not status_cmp_ok then
|
||||||
|
return
|
||||||
|
end
|
||||||
|
|
||||||
|
-- M.capabilities = vim.lsp.protocol.make_client_capabilities()
|
||||||
|
M.capabilities = cmp_nvim_lsp.default_capabilities()
|
||||||
|
M.capabilities.textDocument.completion.completionItem.snippetSupport = true
|
||||||
|
-- M.capabilities = cmp_nvim_lsp.update_capabilities(M.capabilities)
|
||||||
|
|
||||||
|
M.setup = function()
|
||||||
|
local signs = {
|
||||||
|
|
||||||
|
{ name = "DiagnosticSignError", text = "" },
|
||||||
|
{ name = "DiagnosticSignWarn", text = "" },
|
||||||
|
{ name = "DiagnosticSignHint", text = "" },
|
||||||
|
{ name = "DiagnosticSignInfo", text = "" },
|
||||||
|
}
|
||||||
|
|
||||||
|
for _, sign in ipairs(signs) do
|
||||||
|
vim.fn.sign_define(sign.name, { texthl = sign.name, text = sign.text, numhl = "" })
|
||||||
|
end
|
||||||
|
|
||||||
|
local config = {
|
||||||
|
virtual_text = true, -- disable virtual text
|
||||||
|
signs = {
|
||||||
|
active = signs, -- show signs
|
||||||
|
},
|
||||||
|
update_in_insert = true,
|
||||||
|
underline = true,
|
||||||
|
severity_sort = true,
|
||||||
|
float = {
|
||||||
|
focusable = true,
|
||||||
|
style = "minimal",
|
||||||
|
border = "rounded",
|
||||||
|
source = "always",
|
||||||
|
header = "",
|
||||||
|
prefix = "",
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
||||||
|
vim.diagnostic.config(config)
|
||||||
|
|
||||||
|
vim.lsp.handlers["textDocument/hover"] = vim.lsp.with(vim.lsp.handlers.hover, {
|
||||||
|
border = "rounded",
|
||||||
|
})
|
||||||
|
|
||||||
|
vim.lsp.handlers["textDocument/signatureHelp"] = vim.lsp.with(vim.lsp.handlers.signature_help, {
|
||||||
|
border = "rounded",
|
||||||
|
})
|
||||||
|
end
|
||||||
|
|
||||||
|
local function lsp_keymaps(bufnr)
|
||||||
|
local opts = { noremap = true, silent = true }
|
||||||
|
local keymap = vim.api.nvim_buf_set_keymap
|
||||||
|
keymap(bufnr, "n", "gD", "<cmd>lua vim.lsp.buf.declaration()<CR>", opts)
|
||||||
|
keymap(bufnr, "n", "gd", "<cmd>lua vim.lsp.buf.definition()<CR>", opts)
|
||||||
|
keymap(bufnr, "n", "K", "<cmd>lua vim.lsp.buf.hover()<CR>", opts)
|
||||||
|
keymap(bufnr, "n", "gI", "<cmd>lua vim.lsp.buf.implementation()<CR>", opts)
|
||||||
|
keymap(bufnr, "n", "gr", "<cmd>lua vim.lsp.buf.references()<CR>", opts)
|
||||||
|
keymap(bufnr, "n", "gl", "<cmd>lua vim.diagnostic.open_float()<CR>", opts)
|
||||||
|
|
||||||
|
keymap(bufnr, "n", "<leader>lf", "<cmd>lua vim.lsp.buf.format{ async = true }<cr>", opts)
|
||||||
|
keymap(bufnr, "v", "<leader>lf", "<esc><cmd>'<,'>lua vim.lsp.buf.format()<cr>", opts)
|
||||||
|
keymap(bufnr, "x", "<leader>lf", "<esc><cmd>'<,'>lua vim.lsp.buf.format()<cr>", opts)
|
||||||
|
|
||||||
|
keymap(bufnr, "n", "<leader>li", "<cmd>LspInfo<cr>", opts)
|
||||||
|
keymap(bufnr, "n", "<leader>lI", "<cmd>LspInstallInfo<cr>", opts)
|
||||||
|
keymap(bufnr, "n", "<leader>la", "<cmd>lua vim.lsp.buf.code_action()<cr>", opts)
|
||||||
|
keymap(bufnr, "n", "<M-.>", "<cmd>lua vim.lsp.buf.code_action()<cr>", opts)
|
||||||
|
keymap(bufnr, "n", "<leader>lj", "<cmd>lua vim.diagnostic.goto_next({buffer=0})<cr>", opts)
|
||||||
|
keymap(bufnr, "n", "<leader>lk", "<cmd>lua vim.diagnostic.goto_prev({buffer=0})<cr>", opts)
|
||||||
|
keymap(bufnr, "n", "<leader>lr", "<cmd>lua vim.lsp.buf.rename()<cr>", opts)
|
||||||
|
keymap(bufnr, "n", "<leader>ls", "<cmd>lua vim.lsp.buf.signature_help()<CR>", opts)
|
||||||
|
keymap(bufnr, "n", "<leader>lq", "<cmd>lua vim.diagnostic.setloclist()<CR>", opts)
|
||||||
|
keymap(bufnr, "v", "<leader>lf", "<esc><cmd>'<,'>lua vim.lsp.buf.format{ async = true }<cr>", opts)
|
||||||
|
keymap(bufnr, "x", "<leader>lf", "<esc><cmd>'<,'>lua vim.lsp.buf.format{ async = true }<cr>", opts)
|
||||||
|
end
|
||||||
|
|
||||||
|
M.on_attach = function(client, bufnr)
|
||||||
|
if client.name == "tsserver" then
|
||||||
|
client.server_capabilities.documentFormattingProvider = false
|
||||||
|
end
|
||||||
|
|
||||||
|
if client.name == "lua_ls" then
|
||||||
|
client.server_capabilities.documentFormattingProvider = false
|
||||||
|
end
|
||||||
|
|
||||||
|
lsp_keymaps(bufnr)
|
||||||
|
local status_ok, illuminate = pcall(require, "illuminate")
|
||||||
|
if not status_ok then
|
||||||
|
return
|
||||||
|
end
|
||||||
|
illuminate.on_attach(client)
|
||||||
|
end
|
||||||
|
|
||||||
|
return M
|
8
lua/user/lsp/init.lua
Normal file
8
lua/user/lsp/init.lua
Normal file
|
@ -0,0 +1,8 @@
|
||||||
|
local status_ok, _ = pcall(require, "lspconfig")
|
||||||
|
if not status_ok then
|
||||||
|
return
|
||||||
|
end
|
||||||
|
|
||||||
|
require("user.lsp.mason")
|
||||||
|
require("user.lsp.handlers").setup()
|
||||||
|
require("user.lsp.null-ls")
|
57
lua/user/lsp/mason.lua
Normal file
57
lua/user/lsp/mason.lua
Normal file
|
@ -0,0 +1,57 @@
|
||||||
|
local servers = {
|
||||||
|
"lua_ls",
|
||||||
|
"cssls",
|
||||||
|
"html",
|
||||||
|
"tsserver",
|
||||||
|
"pyright",
|
||||||
|
"bashls",
|
||||||
|
"jsonls",
|
||||||
|
"yamlls",
|
||||||
|
"rust_analyzer",
|
||||||
|
"gopls",
|
||||||
|
"clangd",
|
||||||
|
"taplo",
|
||||||
|
"phpactor",
|
||||||
|
}
|
||||||
|
|
||||||
|
local settings = {
|
||||||
|
ui = {
|
||||||
|
border = "none",
|
||||||
|
icons = {
|
||||||
|
package_installed = "◍",
|
||||||
|
package_pending = "◍",
|
||||||
|
package_uninstalled = "◍",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
log_level = vim.log.levels.INFO,
|
||||||
|
max_concurrent_installers = 4,
|
||||||
|
}
|
||||||
|
|
||||||
|
require("mason").setup(settings)
|
||||||
|
require("mason-lspconfig").setup({
|
||||||
|
ensure_installed = servers,
|
||||||
|
automatic_installation = false,
|
||||||
|
})
|
||||||
|
|
||||||
|
local lspconfig_status_ok, lspconfig = pcall(require, "lspconfig")
|
||||||
|
if not lspconfig_status_ok then
|
||||||
|
return
|
||||||
|
end
|
||||||
|
|
||||||
|
local opts = {}
|
||||||
|
|
||||||
|
for _, server in pairs(servers) do
|
||||||
|
opts = {
|
||||||
|
on_attach = require("user.lsp.handlers").on_attach,
|
||||||
|
capabilities = require("user.lsp.handlers").capabilities,
|
||||||
|
}
|
||||||
|
|
||||||
|
server = vim.split(server, "@")[1]
|
||||||
|
|
||||||
|
local require_ok, conf_opts = pcall(require, "user.lsp.settings." .. server)
|
||||||
|
if require_ok then
|
||||||
|
opts = vim.tbl_deep_extend("force", conf_opts, opts)
|
||||||
|
end
|
||||||
|
|
||||||
|
lspconfig[server].setup(opts)
|
||||||
|
end
|
25
lua/user/lsp/null-ls.lua
Normal file
25
lua/user/lsp/null-ls.lua
Normal file
|
@ -0,0 +1,25 @@
|
||||||
|
local null_ls_status_ok, null_ls = pcall(require, "null-ls")
|
||||||
|
if not null_ls_status_ok then
|
||||||
|
return
|
||||||
|
end
|
||||||
|
|
||||||
|
-- https://github.com/jose-elias-alvarez/null-ls.nvim/tree/main/lua/null-ls/builtins/formatting
|
||||||
|
local formatting = null_ls.builtins.formatting
|
||||||
|
-- https://github.com/jose-elias-alvarez/null-ls.nvim/tree/main/lua/null-ls/builtins/diagnostics
|
||||||
|
local diagnostics = null_ls.builtins.diagnostics
|
||||||
|
|
||||||
|
-- https://github.com/prettier-solidity/prettier-plugin-solidity
|
||||||
|
null_ls.setup {
|
||||||
|
debug = false,
|
||||||
|
sources = {
|
||||||
|
formatting.prettier,
|
||||||
|
-- formatting.prettier.with {
|
||||||
|
-- extra_filetypes = { "toml" },
|
||||||
|
-- extra_args = { "--no-semi", "--single-quote", "--jsx-single-quote" },
|
||||||
|
-- },
|
||||||
|
formatting.black.with { extra_args = { "--fast" } },
|
||||||
|
formatting.stylua,
|
||||||
|
formatting.google_java_format,
|
||||||
|
diagnostics.flake8,
|
||||||
|
},
|
||||||
|
}
|
9
lua/user/lsp/settings/pyright.lua
Normal file
9
lua/user/lsp/settings/pyright.lua
Normal file
|
@ -0,0 +1,9 @@
|
||||||
|
return {
|
||||||
|
settings = {
|
||||||
|
python = {
|
||||||
|
analysis = {
|
||||||
|
typeCheckingMode = "on",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
}
|
9
lua/user/lsp/settings/rust_analyzer.lua
Normal file
9
lua/user/lsp/settings/rust_analyzer.lua
Normal file
|
@ -0,0 +1,9 @@
|
||||||
|
return {
|
||||||
|
settings = {
|
||||||
|
["rust-analyzer"] = {
|
||||||
|
checkOnSave = {
|
||||||
|
command = "clippy",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
}
|
18
lua/user/lsp/settings/sumneko_lua.lua
Normal file
18
lua/user/lsp/settings/sumneko_lua.lua
Normal file
|
@ -0,0 +1,18 @@
|
||||||
|
return {
|
||||||
|
settings = {
|
||||||
|
Lua = {
|
||||||
|
diagnostics = {
|
||||||
|
globals = { "vim" },
|
||||||
|
},
|
||||||
|
workspace = {
|
||||||
|
library = {
|
||||||
|
[vim.fn.expand "$VIMRUNTIME/lua"] = false,
|
||||||
|
[vim.fn.stdpath "config" .. "/lua"] = false,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
telemetry = {
|
||||||
|
enable = false,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
}
|
7
lua/user/lsp/settings/yamlls.lua
Normal file
7
lua/user/lsp/settings/yamlls.lua
Normal file
|
@ -0,0 +1,7 @@
|
||||||
|
return {
|
||||||
|
settings = {
|
||||||
|
yaml = {
|
||||||
|
keyOrdering = false
|
||||||
|
},
|
||||||
|
},
|
||||||
|
}
|
11
lua/user/lsp/signature.lua
Normal file
11
lua/user/lsp/signature.lua
Normal file
|
@ -0,0 +1,11 @@
|
||||||
|
local ok, lsp_signature = pcall(require, "lsp_signature")
|
||||||
|
if not ok then
|
||||||
|
return
|
||||||
|
end
|
||||||
|
|
||||||
|
lsp_signature.setup({
|
||||||
|
bind = true,
|
||||||
|
handler_opts = {
|
||||||
|
border = "rounded",
|
||||||
|
},
|
||||||
|
})
|
58
lua/user/lualine.lua
Normal file
58
lua/user/lualine.lua
Normal file
|
@ -0,0 +1,58 @@
|
||||||
|
local status_ok, lualine = pcall(require, "lualine")
|
||||||
|
if not status_ok then
|
||||||
|
return
|
||||||
|
end
|
||||||
|
|
||||||
|
local hide_in_width = function()
|
||||||
|
return vim.fn.winwidth(0) > 80
|
||||||
|
end
|
||||||
|
|
||||||
|
local diagnostics = {
|
||||||
|
"diagnostics",
|
||||||
|
sources = { "nvim_diagnostic" },
|
||||||
|
sections = { "error", "warn" },
|
||||||
|
symbols = { error = " ", warn = " " },
|
||||||
|
colored = true,
|
||||||
|
always_visible = true,
|
||||||
|
}
|
||||||
|
|
||||||
|
local diff = {
|
||||||
|
"diff",
|
||||||
|
colored = true,
|
||||||
|
symbols = { added = " ", modified = " ", removed = " " }, -- changes diff symbols
|
||||||
|
cond = hide_in_width,
|
||||||
|
}
|
||||||
|
|
||||||
|
local filetype = {
|
||||||
|
"filetype",
|
||||||
|
icons_enabled = true,
|
||||||
|
}
|
||||||
|
|
||||||
|
local location = {
|
||||||
|
"location",
|
||||||
|
padding = { right = 1 },
|
||||||
|
}
|
||||||
|
|
||||||
|
-- local spaces = function()
|
||||||
|
-- return "spaces: " .. vim.api.nvim_buf_get_option(0, "shiftwidth")
|
||||||
|
-- end
|
||||||
|
|
||||||
|
lualine.setup {
|
||||||
|
options = {
|
||||||
|
globalstatus = true,
|
||||||
|
icons_enabled = true,
|
||||||
|
theme = "auto",
|
||||||
|
component_separators = { left = "", right = "" },
|
||||||
|
section_separators = { left = "", right = "" },
|
||||||
|
disabled_filetypes = { "alpha", "dashboard" },
|
||||||
|
always_divide_middle = true,
|
||||||
|
},
|
||||||
|
sections = {
|
||||||
|
lualine_a = { "mode" },
|
||||||
|
lualine_b = {"branch"},
|
||||||
|
lualine_c = { diagnostics },
|
||||||
|
lualine_x = { diff, filetype },
|
||||||
|
lualine_y = { location },
|
||||||
|
lualine_z = { "progress" },
|
||||||
|
},
|
||||||
|
}
|
67
lua/user/nvim-tree.lua
Normal file
67
lua/user/nvim-tree.lua
Normal file
|
@ -0,0 +1,67 @@
|
||||||
|
local status_ok, nvim_tree = pcall(require, "nvim-tree")
|
||||||
|
if not status_ok then
|
||||||
|
return
|
||||||
|
end
|
||||||
|
|
||||||
|
local config_status_ok, nvim_tree_config = pcall(require, "nvim-tree.config")
|
||||||
|
if not config_status_ok then
|
||||||
|
return
|
||||||
|
end
|
||||||
|
|
||||||
|
local tree_cb = nvim_tree_config.nvim_tree_callback
|
||||||
|
|
||||||
|
nvim_tree.setup {
|
||||||
|
update_focused_file = {
|
||||||
|
enable = true,
|
||||||
|
update_cwd = true,
|
||||||
|
},
|
||||||
|
renderer = {
|
||||||
|
root_folder_modifier = ":t",
|
||||||
|
icons = {
|
||||||
|
glyphs = {
|
||||||
|
default = "",
|
||||||
|
symlink = "",
|
||||||
|
folder = {
|
||||||
|
arrow_open = "",
|
||||||
|
arrow_closed = "",
|
||||||
|
default = "",
|
||||||
|
open = "",
|
||||||
|
empty = "",
|
||||||
|
empty_open = "",
|
||||||
|
symlink = "",
|
||||||
|
symlink_open = "",
|
||||||
|
},
|
||||||
|
git = {
|
||||||
|
unstaged = "",
|
||||||
|
staged = "S",
|
||||||
|
unmerged = "",
|
||||||
|
renamed = "➜",
|
||||||
|
untracked = "U",
|
||||||
|
deleted = "",
|
||||||
|
ignored = "◌",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
diagnostics = {
|
||||||
|
enable = true,
|
||||||
|
show_on_dirs = true,
|
||||||
|
icons = {
|
||||||
|
hint = "",
|
||||||
|
info = "",
|
||||||
|
warning = "",
|
||||||
|
error = "",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
view = {
|
||||||
|
width = 30,
|
||||||
|
side = "left",
|
||||||
|
mappings = {
|
||||||
|
list = {
|
||||||
|
{ key = { "l", "<CR>", "o" }, cb = tree_cb "edit" },
|
||||||
|
{ key = "h", cb = tree_cb "close_node" },
|
||||||
|
{ key = "v", cb = tree_cb "vsplit" },
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
}
|
40
lua/user/options.lua
Normal file
40
lua/user/options.lua
Normal file
|
@ -0,0 +1,40 @@
|
||||||
|
vim.opt.backup = false -- creates a backup file
|
||||||
|
vim.opt.clipboard = "unnamedplus" -- allows neovim to access the system clipboard
|
||||||
|
vim.opt.cmdheight = 1 -- more space in the neovim command line for displaying messages
|
||||||
|
vim.opt.completeopt = { "menuone", "noselect" } -- mostly just for cmp
|
||||||
|
vim.opt.conceallevel = 0 -- so that `` is visible in markdown files
|
||||||
|
vim.opt.fileencoding = "utf-8" -- the encoding written to a file
|
||||||
|
vim.opt.hlsearch = true -- highlight all matches on previous search pattern
|
||||||
|
vim.opt.ignorecase = true -- ignore case in search patterns
|
||||||
|
vim.opt.mouse = "a" -- allow the mouse to be used in neovim
|
||||||
|
vim.opt.pumheight = 10 -- pop up menu height
|
||||||
|
vim.opt.showmode = false -- we don't need to see things like -- INSERT -- anymore
|
||||||
|
vim.opt.showtabline = 0 -- always show tabs
|
||||||
|
vim.opt.smartcase = true -- smart case
|
||||||
|
vim.opt.smartindent = true -- make indenting smarter again
|
||||||
|
vim.opt.splitbelow = true -- force all horizontal splits to go below current window
|
||||||
|
vim.opt.splitright = true -- force all vertical splits to go to the right of current window
|
||||||
|
vim.opt.swapfile = false -- creates a swapfile
|
||||||
|
vim.opt.termguicolors = true -- set term gui colors (most terminals support this)
|
||||||
|
vim.opt.timeoutlen = 1000 -- time to wait for a mapped sequence to complete (in milliseconds)
|
||||||
|
vim.opt.undofile = true -- enable persistent undo
|
||||||
|
vim.opt.updatetime = 300 -- faster completion (4000ms default)
|
||||||
|
vim.opt.writebackup = false -- if a file is being edited by another program (or was written to file while editing with another program), it is not allowed to be edited
|
||||||
|
vim.opt.expandtab = true -- convert tabs to spaces
|
||||||
|
vim.opt.shiftwidth = 4 -- the number of spaces inserted for each indentation
|
||||||
|
vim.opt.tabstop = 4 -- insert 2 spaces for a tab
|
||||||
|
vim.opt.cursorline = true -- highlight the current line
|
||||||
|
vim.opt.number = true -- set numbered lines
|
||||||
|
vim.opt.laststatus = 3 -- only the last window will always have a status line
|
||||||
|
vim.opt.showcmd = true -- hide (partial) command in the last line of the screen (for performance)
|
||||||
|
vim.opt.ruler = false -- hide the line and column number of the cursor position
|
||||||
|
--vim.opt.numberwidth = 4 -- minimal number of columns to use for the line number {default 4}
|
||||||
|
vim.opt.signcolumn = "yes" -- always show the sign column, otherwise it would shift the text each time
|
||||||
|
vim.opt.wrap = true -- display lines as one long line
|
||||||
|
vim.opt.scrolloff = 8 -- minimal number of screen lines to keep above and below the cursor
|
||||||
|
vim.opt.sidescrolloff = 8 -- minimal number of screen columns to keep to the left and right of the cursor if wrap is `false`
|
||||||
|
vim.opt.guifont = "monospace:h17" -- the font used in graphical neovim applications
|
||||||
|
vim.opt.fillchars.eob=" " -- show empty lines at the end of a buffer as ` ` {default `~`}
|
||||||
|
vim.opt.shortmess:append "c" -- hide all the completion messages, e.g. "-- XXX completion (YYY)", "match 1 of 2", "The only match", "Pattern not found"
|
||||||
|
vim.opt.whichwrap:append("<,>,[,],h,l") -- keys allowed to move to the previous/next line when the beginning/end of line is reached
|
||||||
|
vim.opt.iskeyword:append("-") -- treats words with `-` as single words
|
134
lua/user/plugins.lua
Normal file
134
lua/user/plugins.lua
Normal file
|
@ -0,0 +1,134 @@
|
||||||
|
local fn = vim.fn
|
||||||
|
|
||||||
|
-- Automatically install packer
|
||||||
|
local install_path = fn.stdpath("data") .. "/site/pack/packer/start/packer.nvim"
|
||||||
|
if fn.empty(fn.glob(install_path)) > 0 then
|
||||||
|
PACKER_BOOTSTRAP = fn.system({
|
||||||
|
"git",
|
||||||
|
"clone",
|
||||||
|
"--depth",
|
||||||
|
"1",
|
||||||
|
"https://github.com/wbthomason/packer.nvim",
|
||||||
|
install_path,
|
||||||
|
})
|
||||||
|
print("Installing packer close and reopen Neovim...")
|
||||||
|
vim.cmd([[packadd packer.nvim]])
|
||||||
|
end
|
||||||
|
|
||||||
|
-- Autocommand that reloads neovim whenever you save the plugins.lua file
|
||||||
|
vim.cmd([[
|
||||||
|
augroup packer_user_config
|
||||||
|
autocmd!
|
||||||
|
autocmd BufWritePost plugins.lua source <afile> | PackerSync
|
||||||
|
augroup end
|
||||||
|
]])
|
||||||
|
|
||||||
|
-- Use a protected call so we don't error out on first use
|
||||||
|
local status_ok, packer = pcall(require, "packer")
|
||||||
|
if not status_ok then
|
||||||
|
return
|
||||||
|
end
|
||||||
|
|
||||||
|
-- Have packer use a popup window
|
||||||
|
packer.init({
|
||||||
|
display = {
|
||||||
|
open_fn = function()
|
||||||
|
return require("packer.util").float({ border = "rounded" })
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
git = {
|
||||||
|
clone_timeout = 300, -- Timeout, in seconds, for git clones
|
||||||
|
},
|
||||||
|
})
|
||||||
|
|
||||||
|
-- Install your plugins here
|
||||||
|
return packer.startup(function(use)
|
||||||
|
-- My plugins here
|
||||||
|
use({ "wbthomason/packer.nvim", commit = "6afb67460283f0e990d35d229fd38fdc04063e0a" }) -- Have packer manage itself
|
||||||
|
use({ "nvim-lua/plenary.nvim", commit = "4b7e52044bbb84242158d977a50c4cbcd85070c7" }) -- Useful lua functions used by lots of plugins
|
||||||
|
--use { "windwp/nvim-autopairs", commit = "4fc96c8f3df89b6d23e5092d31c866c53a346347" } -- Autopairs, integrates with both cmp and treesitter
|
||||||
|
use({ "numToStr/Comment.nvim", commit = "97a188a98b5a3a6f9b1b850799ac078faa17ab67" })
|
||||||
|
use({ "JoosepAlviste/nvim-ts-context-commentstring", commit = "4d3a68c41a53add8804f471fcc49bb398fe8de08" })
|
||||||
|
use({ "kyazdani42/nvim-web-devicons", commit = "563f3635c2d8a7be7933b9e547f7c178ba0d4352" })
|
||||||
|
use({ "kyazdani42/nvim-tree.lua", commit = "7282f7de8aedf861fe0162a559fc2b214383c51c" })
|
||||||
|
use({ "akinsho/bufferline.nvim", commit = "83bf4dc7bff642e145c8b4547aa596803a8b4dc4" })
|
||||||
|
use({ "moll/vim-bbye", commit = "25ef93ac5a87526111f43e5110675032dbcacf56" })
|
||||||
|
use({ "nvim-lualine/lualine.nvim" })
|
||||||
|
use({ "akinsho/toggleterm.nvim", commit = "2a787c426ef00cb3488c11b14f5dcf892bbd0bda" })
|
||||||
|
use({ "ahmedkhalf/project.nvim", commit = "628de7e433dd503e782831fe150bb750e56e55d6" })
|
||||||
|
use({ "lewis6991/impatient.nvim", commit = "b842e16ecc1a700f62adb9802f8355b99b52a5a6" })
|
||||||
|
use { "lukas-reineke/indent-blankline.nvim", commit = "db7cbcb40cc00fc5d6074d7569fb37197705e7f6" }
|
||||||
|
use({ "goolord/alpha-nvim", commit = "0bb6fc0646bcd1cdb4639737a1cee8d6e08bcc31" })
|
||||||
|
|
||||||
|
-- Colorschemes
|
||||||
|
use({ "folke/tokyonight.nvim", commit = "66bfc2e8f754869c7b651f3f47a2ee56ae557764" })
|
||||||
|
use({ "lunarvim/darkplus.nvim", commit = "13ef9daad28d3cf6c5e793acfc16ddbf456e1c83" })
|
||||||
|
use({ "catppuccin/nvim", as = "catppuccin" })
|
||||||
|
|
||||||
|
-- cmp plugins
|
||||||
|
use({ "hrsh7th/nvim-cmp", commit = "b0dff0ec4f2748626aae13f011d1a47071fe9abc" }) -- The completion plugin
|
||||||
|
use({ "hrsh7th/cmp-buffer", commit = "3022dbc9166796b644a841a02de8dd1cc1d311fa" }) -- buffer completions
|
||||||
|
use({ "hrsh7th/cmp-path", commit = "447c87cdd6e6d6a1d2488b1d43108bfa217f56e1" }) -- path completions
|
||||||
|
use({ "saadparwaiz1/cmp_luasnip", commit = "a9de941bcbda508d0a45d28ae366bb3f08db2e36" }) -- snippet completions
|
||||||
|
use({ "hrsh7th/cmp-nvim-lsp" })
|
||||||
|
use({ "hrsh7th/cmp-nvim-lsp-signature-help" })
|
||||||
|
use({ "hrsh7th/cmp-nvim-lua", commit = "d276254e7198ab7d00f117e88e223b4bd8c02d21" })
|
||||||
|
|
||||||
|
-- snippets
|
||||||
|
use({ "L3MON4D3/LuaSnip", commit = "8f8d493e7836f2697df878ef9c128337cbf2bb84" }) --snippet engine
|
||||||
|
use({ "rafamadriz/friendly-snippets", commit = "2be79d8a9b03d4175ba6b3d14b082680de1b31b1" }) -- a bunch of snippets to use
|
||||||
|
|
||||||
|
-- LSP
|
||||||
|
-- use { "williamboman/nvim-lsp-installer", commit = "e9f13d7acaa60aff91c58b923002228668c8c9e6" } -- simple to use language server installer
|
||||||
|
use({ "neovim/nvim-lspconfig" }) -- enable LSP
|
||||||
|
use({ "williamboman/mason.nvim" })
|
||||||
|
use({ "williamboman/mason-lspconfig.nvim" })
|
||||||
|
use({ "jose-elias-alvarez/null-ls.nvim" }) -- for formatters and linters
|
||||||
|
use({ "RRethy/vim-illuminate" })
|
||||||
|
|
||||||
|
-- Telescope
|
||||||
|
use({ "nvim-telescope/telescope.nvim", commit = "76ea9a898d3307244dce3573392dcf2cc38f340f" })
|
||||||
|
|
||||||
|
-- Treesitter
|
||||||
|
use({
|
||||||
|
"nvim-treesitter/nvim-treesitter",
|
||||||
|
})
|
||||||
|
use({
|
||||||
|
"nvim-treesitter/nvim-treesitter-context",
|
||||||
|
})
|
||||||
|
|
||||||
|
-- Git
|
||||||
|
use({ "lewis6991/gitsigns.nvim", commit = "f98c85e7c3d65a51f45863a34feb4849c82f240f" })
|
||||||
|
|
||||||
|
-- DAP
|
||||||
|
use({ "mfussenegger/nvim-dap" })
|
||||||
|
use({ "rcarriga/nvim-dap-ui" })
|
||||||
|
use({ "ravenxrz/DAPInstall.nvim" })
|
||||||
|
|
||||||
|
use({ "MunifTanjim/exrc.nvim" })
|
||||||
|
-- use { "simrat39/rust-tools.nvim" }
|
||||||
|
-- use { "mfussenegger/nvim-dap-python" }
|
||||||
|
use({ "jayp0521/mason-nvim-dap.nvim" })
|
||||||
|
|
||||||
|
use("farmergreg/vim-lastplace")
|
||||||
|
use("fedepujol/move.nvim")
|
||||||
|
|
||||||
|
use({ "j-hui/fidget.nvim", commit = "2cf9997d3bde2323a1a0934826ec553423005a26" })
|
||||||
|
use({ "mg979/vim-visual-multi" })
|
||||||
|
|
||||||
|
use({ "vala-lang/vala.vim" })
|
||||||
|
use({ "folke/which-key.nvim" })
|
||||||
|
|
||||||
|
use({ "mbbill/undotree" })
|
||||||
|
|
||||||
|
use({ "folke/trouble.nvim" })
|
||||||
|
use({ 'nvim-telescope/telescope-fzf-native.nvim', run = 'make' })
|
||||||
|
-- use({ "ray-x/lsp_signature.nvim" })
|
||||||
|
use({ "ray-x/lsp_signature.nvim" })
|
||||||
|
|
||||||
|
-- Automatically set up your configuration after cloning packer.nvim
|
||||||
|
-- Put this at the end after all plugins
|
||||||
|
if PACKER_BOOTSTRAP then
|
||||||
|
require("packer").sync()
|
||||||
|
end
|
||||||
|
end)
|
19
lua/user/project.lua
Normal file
19
lua/user/project.lua
Normal file
|
@ -0,0 +1,19 @@
|
||||||
|
local status_ok, project = pcall(require, "project_nvim")
|
||||||
|
if not status_ok then
|
||||||
|
return
|
||||||
|
end
|
||||||
|
project.setup({
|
||||||
|
|
||||||
|
-- detection_methods = { "lsp", "pattern" }, -- NOTE: lsp detection will get annoying with multiple langs in one project
|
||||||
|
detection_methods = { "pattern" },
|
||||||
|
|
||||||
|
-- patterns used to detect root dir, when **"pattern"** is in detection_methods
|
||||||
|
patterns = { "serverless.yml", ".git", "Makefile", "package.json", "Cargo.toml" },
|
||||||
|
})
|
||||||
|
|
||||||
|
local tele_status_ok, telescope = pcall(require, "telescope")
|
||||||
|
if not tele_status_ok then
|
||||||
|
return
|
||||||
|
end
|
||||||
|
|
||||||
|
telescope.load_extension('projects')
|
37
lua/user/telescope.lua
Normal file
37
lua/user/telescope.lua
Normal file
|
@ -0,0 +1,37 @@
|
||||||
|
local status_ok, telescope = pcall(require, "telescope")
|
||||||
|
if not status_ok then
|
||||||
|
return
|
||||||
|
end
|
||||||
|
|
||||||
|
local actions = require "telescope.actions"
|
||||||
|
|
||||||
|
telescope.setup {
|
||||||
|
defaults = {
|
||||||
|
|
||||||
|
prompt_prefix = " ",
|
||||||
|
selection_caret = " ",
|
||||||
|
path_display = { "smart" },
|
||||||
|
file_ignore_patterns = { ".git/", "node_modules" },
|
||||||
|
|
||||||
|
mappings = {
|
||||||
|
i = {
|
||||||
|
["<Down>"] = actions.cycle_history_next,
|
||||||
|
["<Up>"] = actions.cycle_history_prev,
|
||||||
|
["<C-j>"] = actions.move_selection_next,
|
||||||
|
["<C-k>"] = actions.move_selection_previous,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
extensions = {
|
||||||
|
fzf = {
|
||||||
|
fuzzy = true, -- false will only do exact matching
|
||||||
|
override_generic_sorter = true, -- override the generic sorter
|
||||||
|
override_file_sorter = true, -- override the file sorter
|
||||||
|
case_mode = "smart_case", -- or "ignore_case" or "respect_case"
|
||||||
|
-- the default case_mode is "smart_case"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
||||||
|
telescope.load_extension('fzf')
|
||||||
|
|
40
lua/user/toggleterm.lua
Normal file
40
lua/user/toggleterm.lua
Normal file
|
@ -0,0 +1,40 @@
|
||||||
|
local status_ok, toggleterm = pcall(require, "toggleterm")
|
||||||
|
if not status_ok then
|
||||||
|
return
|
||||||
|
end
|
||||||
|
|
||||||
|
toggleterm.setup({
|
||||||
|
size = 20,
|
||||||
|
open_mapping = [[<c-\>]],
|
||||||
|
hide_numbers = true,
|
||||||
|
shade_terminals = true,
|
||||||
|
shading_factor = 2,
|
||||||
|
start_in_insert = true,
|
||||||
|
insert_mappings = true,
|
||||||
|
persist_size = true,
|
||||||
|
direction = "float",
|
||||||
|
close_on_exit = true,
|
||||||
|
shell = vim.o.shell,
|
||||||
|
float_opts = {
|
||||||
|
border = "curved",
|
||||||
|
},
|
||||||
|
})
|
||||||
|
|
||||||
|
function _G.set_terminal_keymaps()
|
||||||
|
local opts = {noremap = true}
|
||||||
|
-- vim.api.nvim_buf_set_keymap(0, 't', '<esc>', [[<C-\><C-n>]], opts)
|
||||||
|
vim.api.nvim_buf_set_keymap(0, 't', '<C-h>', [[<C-\><C-n><C-W>h]], opts)
|
||||||
|
vim.api.nvim_buf_set_keymap(0, 't', '<C-j>', [[<C-\><C-n><C-W>j]], opts)
|
||||||
|
vim.api.nvim_buf_set_keymap(0, 't', '<C-k>', [[<C-\><C-n><C-W>k]], opts)
|
||||||
|
vim.api.nvim_buf_set_keymap(0, 't', '<C-l>', [[<C-\><C-n><C-W>l]], opts)
|
||||||
|
end
|
||||||
|
|
||||||
|
vim.cmd('autocmd! TermOpen term://* lua set_terminal_keymaps()')
|
||||||
|
|
||||||
|
local Terminal = require("toggleterm.terminal").Terminal
|
||||||
|
local lazygit = Terminal:new({ cmd = "lazygit", hidden = true })
|
||||||
|
|
||||||
|
function _LAZYGIT_TOGGLE()
|
||||||
|
lazygit:toggle()
|
||||||
|
end
|
||||||
|
|
88
lua/user/treesitter.lua
Normal file
88
lua/user/treesitter.lua
Normal file
|
@ -0,0 +1,88 @@
|
||||||
|
local status_ok, _ = pcall(require, "nvim-treesitter")
|
||||||
|
if not status_ok then
|
||||||
|
return
|
||||||
|
end
|
||||||
|
|
||||||
|
vim.api.nvim_create_autocmd("BufEnter", {
|
||||||
|
callback = function()
|
||||||
|
local ok, stats = pcall(vim.loop.fs_stat, vim.api.nvim_buf_get_name(vim.api.nvim_get_current_buf()))
|
||||||
|
if ok and stats and stats.size > 1024 * 1024 then
|
||||||
|
-- require("nvim-treesitter.configs").setup({highlight = { enable = false }})
|
||||||
|
end
|
||||||
|
end,
|
||||||
|
})
|
||||||
|
|
||||||
|
vim.cmd("set foldmethod=expr")
|
||||||
|
vim.cmd("set foldexpr=nvim_treesitter#foldexpr()")
|
||||||
|
vim.cmd("set nofoldenable")
|
||||||
|
|
||||||
|
local configs
|
||||||
|
status_ok, configs = pcall(require, "nvim-treesitter.configs")
|
||||||
|
if not status_ok then
|
||||||
|
return
|
||||||
|
end
|
||||||
|
|
||||||
|
configs.setup({
|
||||||
|
ensure_installed = { "lua", "markdown", "markdown_inline", "bash", "python" }, -- put the language you want in this array
|
||||||
|
-- ensure_installed = "all", -- one of "all" or a list of languages
|
||||||
|
ignore_install = { "" }, -- List of parsers to ignore installing
|
||||||
|
sync_install = false, -- install languages synchronously (only applied to `ensure_installed`)
|
||||||
|
|
||||||
|
highlight = {
|
||||||
|
enable = true, -- false will disable the whole extension
|
||||||
|
-- disable = { "css", "help" },
|
||||||
|
disable = function(lang, buf)
|
||||||
|
if vim.tbl_contains({ "help", "latex" }, lang) then
|
||||||
|
return true
|
||||||
|
end
|
||||||
|
|
||||||
|
local max_filesize = 1024 * 1024
|
||||||
|
local ok, stats = pcall(vim.loop.fs_stat, vim.api.nvim_buf_get_name(buf))
|
||||||
|
if ok and stats and stats.size > max_filesize then
|
||||||
|
-- if vim.builtin.illuminate.active then
|
||||||
|
-- pcall(require("illuminate").pause_buf)
|
||||||
|
-- end
|
||||||
|
|
||||||
|
vim.schedule(function()
|
||||||
|
vim.api.nvim_buf_call(buf, function()
|
||||||
|
vim.cmd("setlocal noswapfile noundofile")
|
||||||
|
|
||||||
|
if vim.tbl_contains({ "json" }, lang) then
|
||||||
|
vim.cmd("NoMatchParen")
|
||||||
|
vim.cmd("syntax off")
|
||||||
|
vim.cmd("syntax clear")
|
||||||
|
vim.cmd("setlocal nocursorline nolist bufhidden=unload")
|
||||||
|
|
||||||
|
vim.api.nvim_create_autocmd({ "BufDelete" }, {
|
||||||
|
callback = function()
|
||||||
|
vim.cmd("DoMatchParen")
|
||||||
|
vim.cmd("syntax on")
|
||||||
|
end,
|
||||||
|
buffer = buf,
|
||||||
|
})
|
||||||
|
end
|
||||||
|
end)
|
||||||
|
end)
|
||||||
|
|
||||||
|
return true
|
||||||
|
end
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
autopairs = {
|
||||||
|
enable = true,
|
||||||
|
},
|
||||||
|
indent = { enable = true, disable = { "python", "css", "rust" } },
|
||||||
|
|
||||||
|
context_commentstring = {
|
||||||
|
enable = true,
|
||||||
|
enable_autocmd = false,
|
||||||
|
},
|
||||||
|
})
|
||||||
|
|
||||||
|
local context
|
||||||
|
status_ok, context = pcall(require, "nvim-treesitter.context")
|
||||||
|
if not status_ok then
|
||||||
|
return
|
||||||
|
end
|
||||||
|
|
||||||
|
context.setup({})
|
5
lua/user/vimspector.lua
Normal file
5
lua/user/vimspector.lua
Normal file
|
@ -0,0 +1,5 @@
|
||||||
|
vim.cmd [[
|
||||||
|
sign define vimspectorBP text=\ ● texthl=ErrorMsg
|
||||||
|
sign define vimspectorPC text=\ ▶ texthl=ErrorMsg linehl=CursorLine
|
||||||
|
sign define vimspectorPCBP text=●▶ texthl=ErrorMsg linehl=CursorLine
|
||||||
|
]]
|
10
lua/user/whichkey.lua
Normal file
10
lua/user/whichkey.lua
Normal file
|
@ -0,0 +1,10 @@
|
||||||
|
local ok, whichkey = pcall(require, "which-key")
|
||||||
|
if not ok then
|
||||||
|
return
|
||||||
|
end
|
||||||
|
|
||||||
|
whichkey.setup({
|
||||||
|
window = {
|
||||||
|
border = "single", -- none, single, double, shadow
|
||||||
|
}
|
||||||
|
})
|
|
@ -1,3 +0,0 @@
|
||||||
indent_type = "Spaces"
|
|
||||||
indent_width = 2
|
|
||||||
column_width = 120
|
|
Loading…
Reference in a new issue