Trying LazyVim
This commit is contained in:
parent
c9075e6d72
commit
7ad1a4d995
43 changed files with 588 additions and 1614 deletions
53
.gitignore
vendored
53
.gitignore
vendored
|
@ -1,45 +1,8 @@
|
|||
# Compiled Lua sources
|
||||
luac.out
|
||||
|
||||
# luarocks build files
|
||||
*.src.rock
|
||||
*.zip
|
||||
*.tar.gz
|
||||
|
||||
# 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/
|
||||
tt.*
|
||||
.tests
|
||||
doc/tags
|
||||
debug
|
||||
.repro
|
||||
foo.*
|
||||
*.log
|
||||
data
|
||||
|
|
15
.neoconf.json
Normal file
15
.neoconf.json
Normal file
|
@ -0,0 +1,15 @@
|
|||
{
|
||||
"neodev": {
|
||||
"library": {
|
||||
"enabled": true,
|
||||
"plugins": true
|
||||
}
|
||||
},
|
||||
"neoconf": {
|
||||
"plugins": {
|
||||
"lua_ls": {
|
||||
"enabled": true
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
30
init.lua
30
init.lua
|
@ -1,28 +1,2 @@
|
|||
-- keep these above
|
||||
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"
|
||||
-- bootstrap lazy.nvim, LazyVim and your plugins
|
||||
require("config.lazy")
|
||||
|
|
52
lazy-lock.json
Normal file
52
lazy-lock.json
Normal file
|
@ -0,0 +1,52 @@
|
|||
{
|
||||
"LazyVim": { "branch": "main", "commit": "b1b5b461bf9d853d8472ee5b968471695118958b" },
|
||||
"LuaSnip": { "branch": "master", "commit": "836d4f5a9970819b60b1010fd8709a2ff88416d8" },
|
||||
"alpha-nvim": { "branch": "main", "commit": "906649c3991903d14cef8fae1fe5557193ca743c" },
|
||||
"bufferline.nvim": { "branch": "main", "commit": "3677aceb9a72630b0613e56516c8f7151b86f95c" },
|
||||
"catppuccin": { "branch": "main", "commit": "a2bb81951ef18137d4e25a7972f234937f5ee747" },
|
||||
"cmp-buffer": { "branch": "main", "commit": "3022dbc9166796b644a841a02de8dd1cc1d311fa" },
|
||||
"cmp-nvim-lsp": { "branch": "main", "commit": "0e6b2ed705ddcff9738ec4ea838141654f12eeef" },
|
||||
"cmp-path": { "branch": "main", "commit": "91ff86cd9c29299a64f968ebb45846c485725f23" },
|
||||
"cmp_luasnip": { "branch": "master", "commit": "18095520391186d634a0045dacaa346291096566" },
|
||||
"dressing.nvim": { "branch": "master", "commit": "5f44f829481640be0f96759c965ae22a3bcaf7ce" },
|
||||
"flit.nvim": { "branch": "main", "commit": "4c1739137acd3e7f03e2065a7be8a4dc41c7e461" },
|
||||
"friendly-snippets": { "branch": "main", "commit": "009887b76f15d16f69ae1341f86a7862f61cf2a1" },
|
||||
"gitsigns.nvim": { "branch": "main", "commit": "b1f9cf7c5c5639c006c937fc1819e09f358210fc" },
|
||||
"indent-blankline.nvim": { "branch": "master", "commit": "018bd04d80c9a73d399c1061fa0c3b14a7614399" },
|
||||
"lazy.nvim": { "branch": "main", "commit": "5b4444f0d7e556deba3f7ca949a2ba0e2c3369fb" },
|
||||
"leap.nvim": { "branch": "main", "commit": "d34680b16af977928228e57c68e5a162f1649e3c" },
|
||||
"lualine.nvim": { "branch": "master", "commit": "e99d733e0213ceb8f548ae6551b04ae32e590c80" },
|
||||
"mason-lspconfig.nvim": { "branch": "main", "commit": "a31e011135a79d63c71254c250c9158e1056a1cb" },
|
||||
"mason.nvim": { "branch": "main", "commit": "a8cef27f071fe34696a9c8fa55829900e2291e86" },
|
||||
"mini.ai": { "branch": "main", "commit": "ce822c6e6fe3aaf7cb29874e669b2d96febc97e5" },
|
||||
"mini.bufremove": { "branch": "main", "commit": "8464390c932556dbb298ccf8a7587d6ef765e94f" },
|
||||
"mini.comment": { "branch": "main", "commit": "5e8c7f75c48d958ef84ed75772b0263284c8621d" },
|
||||
"mini.indentscope": { "branch": "main", "commit": "7998edc970610c05598c7aea3d21ece8dd87ed52" },
|
||||
"mini.pairs": { "branch": "main", "commit": "0256717c9364ad6b5384c37b4f96fb4f7cc74867" },
|
||||
"mini.surround": { "branch": "main", "commit": "b7c2f4bea1f60af8dfee71f696319d045d986ce6" },
|
||||
"neo-tree.nvim": { "branch": "v2.x", "commit": "aec592bb1f0cf67f7e1123053d1eb17700aa9ed4" },
|
||||
"neoconf.nvim": { "branch": "main", "commit": "64df472e5dad68749c5181d87dd8a4b7525db167" },
|
||||
"neodev.nvim": { "branch": "main", "commit": "50eaabc6645b43ded9126f97080bff767063b1c6" },
|
||||
"noice.nvim": { "branch": "main", "commit": "c22651651da01239fc4afac4cdb7261797d5f02e" },
|
||||
"nui.nvim": { "branch": "main", "commit": "0dc148c6ec06577fcf06cbab3b7dac96d48ba6be" },
|
||||
"null-ls.nvim": { "branch": "main", "commit": "900c38cfa91eb7ff2716da70f2f2c1d33741cf0a" },
|
||||
"nvim-cmp": { "branch": "main", "commit": "feed47fd1da7a1bad2c7dca456ea19c8a5a9823a" },
|
||||
"nvim-lspconfig": { "branch": "master", "commit": "f3e6c034d103e3476821af596a67df71d76f85a9" },
|
||||
"nvim-navic": { "branch": "master", "commit": "cdd24539bcf114a499827e9b32869fe74836efe7" },
|
||||
"nvim-notify": { "branch": "master", "commit": "281e4d793c550c866bea3fb85d39de1f0188fb50" },
|
||||
"nvim-spectre": { "branch": "master", "commit": "b71b64afe9fedbfdd25a8abec897ff4af3bd553a" },
|
||||
"nvim-treesitter": { "branch": "master", "commit": "d086563c02a582a552086ea94bfabd5f49d6872a" },
|
||||
"nvim-treesitter-textobjects": { "branch": "master", "commit": "f5f13206ec33e55b16c8e1a9dec301e8bead4835" },
|
||||
"nvim-ts-context-commentstring": { "branch": "main", "commit": "729d83ecb990dc2b30272833c213cc6d49ed5214" },
|
||||
"nvim-web-devicons": { "branch": "master", "commit": "4af94fec29f508159ceab5413383e5dedd6c24e3" },
|
||||
"persistence.nvim": { "branch": "main", "commit": "adcf6913693a0434665d162ee45a186230496f8a" },
|
||||
"plenary.nvim": { "branch": "master", "commit": "253d34830709d690f013daf2853a9d21ad7accab" },
|
||||
"telescope.nvim": { "branch": "master", "commit": "a3f17d3baf70df58b9d3544ea30abe52a7a832c2" },
|
||||
"todo-comments.nvim": { "branch": "main", "commit": "74c7d28cb50b0713c881ef69bcb6cdd77d8907d1" },
|
||||
"tokyonight.nvim": { "branch": "main", "commit": "3ebc29df627c5cf70eb6acb8f0843c9ea9cf6348" },
|
||||
"trouble.nvim": { "branch": "main", "commit": "67337644e38144b444d026b0df2dc5fa0038930f" },
|
||||
"vim-illuminate": { "branch": "master", "commit": "49062ab1dd8fec91833a69f0a1344223dd59d643" },
|
||||
"vim-repeat": { "branch": "master", "commit": "24afe922e6a05891756ecf331f39a1f6743d3d5a" },
|
||||
"vim-startuptime": { "branch": "master", "commit": "6580cf539c33a212f4f5542068a3b4dd2b3ad834" },
|
||||
"which-key.nvim": { "branch": "main", "commit": "fb027738340502b556c3f43051f113bcaa7e8e63" }
|
||||
}
|
3
lua/config/autocmds.lua
Normal file
3
lua/config/autocmds.lua
Normal file
|
@ -0,0 +1,3 @@
|
|||
-- 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
|
181
lua/config/keymaps.lua
Normal file
181
lua/config/keymaps.lua
Normal file
|
@ -0,0 +1,181 @@
|
|||
-- 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 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)
|
||||
--
|
||||
-- -- 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)
|
||||
--
|
||||
-- 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()
|
46
lua/config/lazy.lua
Normal file
46
lua/config/lazy.lua
Normal file
|
@ -0,0 +1,46 @@
|
|||
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.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 }, -- automatically check for plugin updates
|
||||
performance = {
|
||||
rtp = {
|
||||
-- disable some rtp plugins
|
||||
disabled_plugins = {
|
||||
"gzip",
|
||||
-- "matchit",
|
||||
-- "matchparen",
|
||||
-- "netrwPlugin",
|
||||
"tarPlugin",
|
||||
"tohtml",
|
||||
"tutor",
|
||||
"zipPlugin",
|
||||
},
|
||||
},
|
||||
},
|
||||
})
|
3
lua/config/options.lua
Normal file
3
lua/config/options.lua
Normal file
|
@ -0,0 +1,3 @@
|
|||
-- 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
|
8
lua/plugins/core.lua
Normal file
8
lua/plugins/core.lua
Normal file
|
@ -0,0 +1,8 @@
|
|||
return {
|
||||
{
|
||||
"LazyVim/LazyVim",
|
||||
opts = {
|
||||
colorscheme = "catppuccin",
|
||||
},
|
||||
},
|
||||
}
|
267
lua/plugins/example.lua
Normal file
267
lua/plugins/example.lua
Normal file
|
@ -0,0 +1,267 @@
|
|||
-- since this is just an example spec, don't actually load anything here and return an empty spec
|
||||
-- stylua: ignore
|
||||
if true then return {} end
|
||||
|
||||
-- every spec file under config.plugins will be loaded automatically by lazy.nvim
|
||||
--
|
||||
-- In your plugin files, you can:
|
||||
-- * add extra plugins
|
||||
-- * disable/enabled LazyVim plugins
|
||||
-- * override the configuration of LazyVim plugins
|
||||
return {
|
||||
-- add gruvbox
|
||||
{ "ellisonleao/gruvbox.nvim" },
|
||||
|
||||
-- Configure LazyVim to load gruvbox
|
||||
{
|
||||
"LazyVim/LazyVim",
|
||||
opts = {
|
||||
colorscheme = "gruvbox",
|
||||
},
|
||||
},
|
||||
|
||||
-- change trouble config
|
||||
{
|
||||
"folke/trouble.nvim",
|
||||
-- opts will be merged with the parent spec
|
||||
opts = { use_diagnostic_signs = true },
|
||||
},
|
||||
|
||||
-- disable trouble
|
||||
{ "folke/trouble.nvim", enabled = false },
|
||||
|
||||
-- add symbols-outline
|
||||
{
|
||||
"simrat39/symbols-outline.nvim",
|
||||
cmd = "SymbolsOutline",
|
||||
keys = { { "<leader>cs", "<cmd>SymbolsOutline<cr>", desc = "Symbols Outline" } },
|
||||
config = true,
|
||||
},
|
||||
|
||||
-- override nvim-cmp and add cmp-emoji
|
||||
{
|
||||
"hrsh7th/nvim-cmp",
|
||||
dependencies = { "hrsh7th/cmp-emoji" },
|
||||
---@param opts cmp.ConfigSchema
|
||||
opts = function(_, opts)
|
||||
local cmp = require("cmp")
|
||||
opts.sources = cmp.config.sources(vim.list_extend(opts.sources, { { name = "emoji" } }))
|
||||
end,
|
||||
},
|
||||
|
||||
-- change some telescope options and a keymap to browse plugin files
|
||||
{
|
||||
"nvim-telescope/telescope.nvim",
|
||||
keys = {
|
||||
-- add a keymap to browse plugin files
|
||||
-- stylua: ignore
|
||||
{
|
||||
"<leader>fp",
|
||||
function() require("telescope.builtin").find_files({ cwd = require("lazy.core.config").options.root }) end,
|
||||
desc = "Find Plugin File",
|
||||
},
|
||||
},
|
||||
-- change some options
|
||||
opts = {
|
||||
defaults = {
|
||||
layout_strategy = "horizontal",
|
||||
layout_config = { prompt_position = "top" },
|
||||
sorting_strategy = "ascending",
|
||||
winblend = 0,
|
||||
},
|
||||
},
|
||||
},
|
||||
|
||||
-- add telescope-fzf-native
|
||||
{
|
||||
"telescope.nvim",
|
||||
dependencies = {
|
||||
"nvim-telescope/telescope-fzf-native.nvim",
|
||||
build = "make",
|
||||
config = function()
|
||||
require("telescope").load_extension("fzf")
|
||||
end,
|
||||
},
|
||||
},
|
||||
|
||||
-- add pyright to lspconfig
|
||||
{
|
||||
"neovim/nvim-lspconfig",
|
||||
---@class PluginLspOpts
|
||||
opts = {
|
||||
---@type lspconfig.options
|
||||
servers = {
|
||||
-- pyright will be automatically installed with mason and loaded with lspconfig
|
||||
pyright = {},
|
||||
},
|
||||
},
|
||||
},
|
||||
|
||||
-- add tsserver and setup with typescript.nvim instead of lspconfig
|
||||
{
|
||||
"neovim/nvim-lspconfig",
|
||||
dependencies = {
|
||||
"jose-elias-alvarez/typescript.nvim",
|
||||
init = function()
|
||||
require("lazyvim.util").on_attach(function(_, buffer)
|
||||
-- stylua: ignore
|
||||
vim.keymap.set( "n", "<leader>co", "TypescriptOrganizeImports", { buffer = buffer, desc = "Organize Imports" })
|
||||
vim.keymap.set("n", "<leader>cR", "TypescriptRenameFile", { desc = "Rename File", buffer = buffer })
|
||||
end)
|
||||
end,
|
||||
},
|
||||
---@class PluginLspOpts
|
||||
opts = {
|
||||
---@type lspconfig.options
|
||||
servers = {
|
||||
-- tsserver will be automatically installed with mason and loaded with lspconfig
|
||||
tsserver = {},
|
||||
},
|
||||
-- you can do any additional lsp server setup here
|
||||
-- return true if you don't want this server to be setup with lspconfig
|
||||
---@type table<string, fun(server:string, opts:_.lspconfig.options):boolean?>
|
||||
setup = {
|
||||
-- example to setup with typescript.nvim
|
||||
tsserver = function(_, opts)
|
||||
require("typescript").setup({ server = opts })
|
||||
return true
|
||||
end,
|
||||
-- Specify * to use this function as a fallback for any server
|
||||
-- ["*"] = function(server, opts) end,
|
||||
},
|
||||
},
|
||||
},
|
||||
|
||||
-- for typescript, LazyVim also includes extra specs to properly setup lspconfig,
|
||||
-- treesitter, mason and typescript.nvim. So instead of the above, you can use:
|
||||
{ import = "lazyvim.plugins.extras.lang.typescript" },
|
||||
|
||||
-- add more treesitter parsers
|
||||
{
|
||||
"nvim-treesitter/nvim-treesitter",
|
||||
opts = {
|
||||
ensure_installed = {
|
||||
"bash",
|
||||
"help",
|
||||
"html",
|
||||
"javascript",
|
||||
"json",
|
||||
"lua",
|
||||
"markdown",
|
||||
"markdown_inline",
|
||||
"python",
|
||||
"query",
|
||||
"regex",
|
||||
"tsx",
|
||||
"typescript",
|
||||
"vim",
|
||||
"yaml",
|
||||
},
|
||||
},
|
||||
},
|
||||
|
||||
-- since `vim.tbl_deep_extend`, can only merge tables and not lists, the code above
|
||||
-- would overwrite `ensure_installed` with the new value.
|
||||
-- If you'd rather extend the default config, use the code below instead:
|
||||
{
|
||||
"nvim-treesitter/nvim-treesitter",
|
||||
opts = function(_, opts)
|
||||
-- add tsx and treesitter
|
||||
vim.list_extend(opts.ensure_installed, {
|
||||
"tsx",
|
||||
"typescript",
|
||||
})
|
||||
end,
|
||||
},
|
||||
|
||||
-- the opts function can also be used to change the default opts:
|
||||
{
|
||||
"nvim-lualine/lualine.nvim",
|
||||
event = "VeryLazy",
|
||||
opts = function(_, opts)
|
||||
table.insert(opts.sections.lualine_x, "😄")
|
||||
end,
|
||||
},
|
||||
|
||||
-- or you can return new options to override all the defaults
|
||||
{
|
||||
"nvim-lualine/lualine.nvim",
|
||||
event = "VeryLazy",
|
||||
opts = function()
|
||||
return {
|
||||
--[[add your custom lualine config here]]
|
||||
}
|
||||
end,
|
||||
},
|
||||
|
||||
-- use mini.starter instead of alpha
|
||||
{ import = "lazyvim.plugins.extras.ui.mini-starter" },
|
||||
|
||||
-- add jsonls and schemastore ans setup treesitter for json, json5 and jsonc
|
||||
{ import = "lazyvim.plugins.extras.lang.json" },
|
||||
|
||||
-- add any tools you want to have installed below
|
||||
{
|
||||
"williamboman/mason.nvim",
|
||||
opts = {
|
||||
ensure_installed = {
|
||||
"stylua",
|
||||
"shellcheck",
|
||||
"shfmt",
|
||||
"flake8",
|
||||
},
|
||||
},
|
||||
},
|
||||
|
||||
-- Use <tab> for completion and snippets (supertab)
|
||||
-- first: disable default <tab> and <s-tab> behavior in LuaSnip
|
||||
{
|
||||
"L3MON4D3/LuaSnip",
|
||||
keys = function()
|
||||
return {}
|
||||
end,
|
||||
},
|
||||
-- then: setup supertab in cmp
|
||||
{
|
||||
"hrsh7th/nvim-cmp",
|
||||
dependencies = {
|
||||
"hrsh7th/cmp-emoji",
|
||||
},
|
||||
---@param opts cmp.ConfigSchema
|
||||
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
|
||||
|
||||
local luasnip = require("luasnip")
|
||||
local cmp = require("cmp")
|
||||
|
||||
opts.mapping = vim.tbl_extend("force", opts.mapping, {
|
||||
["<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()
|
||||
-- they 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" }),
|
||||
})
|
||||
end,
|
||||
},
|
||||
}
|
|
@ -1,35 +0,0 @@
|
|||
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)
|
|
@ -1,73 +0,0 @@
|
|||
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,
|
||||
})
|
|
@ -1,34 +0,0 @@
|
|||
-- 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({}))
|
|
@ -1,104 +0,0 @@
|
|||
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" },
|
||||
},
|
||||
},
|
||||
}
|
132
lua/user/cmp.lua
132
lua/user/cmp.lua
|
@ -1,132 +0,0 @@
|
|||
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" },
|
||||
},
|
||||
confirm_opts = {
|
||||
behavior = cmp.ConfirmBehavior.Replace,
|
||||
select = false,
|
||||
},
|
||||
window = {
|
||||
completion = cmp.config.window.bordered(),
|
||||
documentation = cmp.config.window.bordered(),
|
||||
},
|
||||
experimental = {
|
||||
ghost_text = true,
|
||||
},
|
||||
})
|
|
@ -1,31 +0,0 @@
|
|||
--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
|
|
@ -1,29 +0,0 @@
|
|||
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,
|
||||
})
|
|
@ -1,65 +0,0 @@
|
|||
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\"}"},
|
||||
-- }
|
||||
-- }
|
|
@ -1,9 +0,0 @@
|
|||
-- Setup exrc
|
||||
local status_ok, exrc = pcall(require, "exrc")
|
||||
if not status_ok then
|
||||
return
|
||||
end
|
||||
|
||||
exrc.setup({
|
||||
files = { ".nvimrc.lua" }
|
||||
})
|
|
@ -1,6 +0,0 @@
|
|||
local ok, fidget = pcall(require, "fidget")
|
||||
if not ok then
|
||||
return
|
||||
end
|
||||
|
||||
fidget.setup()
|
|
@ -1,43 +0,0 @@
|
|||
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
|
||||
}
|
|
@ -1,38 +0,0 @@
|
|||
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,
|
||||
}
|
|
@ -1,6 +0,0 @@
|
|||
local status_ok, impatient = pcall(require, "impatient")
|
||||
if not status_ok then
|
||||
return
|
||||
end
|
||||
|
||||
impatient.enable_profile()
|
|
@ -1,19 +0,0 @@
|
|||
local enabled = false
|
||||
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",
|
||||
-- },
|
||||
--}
|
|
@ -1,177 +0,0 @@
|
|||
-- 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)
|
||||
|
||||
-- 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)
|
||||
|
||||
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()
|
|
@ -1,98 +0,0 @@
|
|||
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.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
|
|
@ -1,8 +0,0 @@
|
|||
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")
|
|
@ -1,91 +0,0 @@
|
|||
local servers = {
|
||||
"lua_ls",
|
||||
"cssls",
|
||||
"html",
|
||||
"tsserver",
|
||||
"pyright",
|
||||
"bashls",
|
||||
"jsonls",
|
||||
"yamlls",
|
||||
"rust_analyzer",
|
||||
"gopls",
|
||||
"clangd",
|
||||
"taplo"
|
||||
}
|
||||
|
||||
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
|
||||
|
||||
local mason_nvim_dap_ok, mason_nvim_dap = pcall(require, "mason-nvim-dap")
|
||||
if mason_nvim_dap_ok then
|
||||
local dap = require('dap')
|
||||
mason_nvim_dap.setup({
|
||||
automatic_setup = true,
|
||||
})
|
||||
mason_nvim_dap.setup_handlers({
|
||||
function(source_name)
|
||||
-- all sources with no handler get passed here
|
||||
|
||||
-- Keep original functionality of `automatic_setup = true`
|
||||
require("mason-nvim-dap.automatic_setup")(source_name)
|
||||
end,
|
||||
python = function(source_name)
|
||||
dap.adapters.python = {
|
||||
type = "executable",
|
||||
command = "/usr/bin/python3",
|
||||
args = {
|
||||
"-m",
|
||||
"debugpy.adapter",
|
||||
},
|
||||
}
|
||||
|
||||
dap.configurations.python = {
|
||||
{
|
||||
type = "python",
|
||||
request = "launch",
|
||||
name = "Launch file",
|
||||
program = "${file}", -- This configuration will launch the current file if used.
|
||||
},
|
||||
}
|
||||
end,
|
||||
})
|
||||
end
|
|
@ -1,25 +0,0 @@
|
|||
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,
|
||||
},
|
||||
}
|
|
@ -1,9 +0,0 @@
|
|||
return {
|
||||
settings = {
|
||||
python = {
|
||||
analysis = {
|
||||
typeCheckingMode = "on",
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
|
@ -1,9 +0,0 @@
|
|||
return {
|
||||
settings = {
|
||||
["rust-analyzer"] = {
|
||||
checkOnSave = {
|
||||
command = "clippy",
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
|
@ -1,18 +0,0 @@
|
|||
return {
|
||||
settings = {
|
||||
Lua = {
|
||||
diagnostics = {
|
||||
globals = { "vim" },
|
||||
},
|
||||
workspace = {
|
||||
library = {
|
||||
[vim.fn.expand "$VIMRUNTIME/lua"] = false,
|
||||
[vim.fn.stdpath "config" .. "/lua"] = false,
|
||||
},
|
||||
},
|
||||
telemetry = {
|
||||
enable = false,
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
|
@ -1,58 +0,0 @@
|
|||
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 = false,
|
||||
always_visible = true,
|
||||
}
|
||||
|
||||
local diff = {
|
||||
"diff",
|
||||
colored = false,
|
||||
symbols = { added = "", modified = "", removed = "" }, -- changes diff symbols
|
||||
cond = hide_in_width,
|
||||
}
|
||||
|
||||
local filetype = {
|
||||
"filetype",
|
||||
icons_enabled = false,
|
||||
}
|
||||
|
||||
local location = {
|
||||
"location",
|
||||
padding = 0,
|
||||
}
|
||||
|
||||
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, spaces, "encoding", filetype },
|
||||
lualine_y = { location },
|
||||
lualine_z = { "progress" },
|
||||
},
|
||||
}
|
|
@ -1,67 +0,0 @@
|
|||
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" },
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
|
@ -1,40 +0,0 @@
|
|||
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
|
|
@ -1,130 +0,0 @@
|
|||
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", commit = "a52f078026b27694d2290e34efa61a6e4a690621" })
|
||||
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", commit = "affe808a5c56b71630f17aa7c38e15c59fd648a8" })
|
||||
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",
|
||||
commit = "1942f3554184e9d9dfb90dcc6542047b8f6511f2",
|
||||
})
|
||||
use({
|
||||
"nvim-treesitter/nvim-treesitter-context",
|
||||
commit = "0dd5eae6dbf226107da2c2041ffbb695d9e267c1",
|
||||
})
|
||||
|
||||
-- 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" })
|
||||
|
||||
-- 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)
|
|
@ -1,19 +0,0 @@
|
|||
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')
|
|
@ -1,25 +0,0 @@
|
|||
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,
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
|
@ -1,40 +0,0 @@
|
|||
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
|
||||
|
|
@ -1,88 +0,0 @@
|
|||
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({})
|
|
@ -1,5 +0,0 @@
|
|||
vim.cmd [[
|
||||
sign define vimspectorBP text=\ ● texthl=ErrorMsg
|
||||
sign define vimspectorPC text=\ ▶ texthl=ErrorMsg linehl=CursorLine
|
||||
sign define vimspectorPCBP text=●▶ texthl=ErrorMsg linehl=CursorLine
|
||||
]]
|
|
@ -1,10 +0,0 @@
|
|||
local ok, whichkey = pcall(require, "which-key")
|
||||
if not ok then
|
||||
return
|
||||
end
|
||||
|
||||
whichkey.setup({
|
||||
window = {
|
||||
border = "single", -- none, single, double, shadow
|
||||
}
|
||||
})
|
3
stylua.toml
Normal file
3
stylua.toml
Normal file
|
@ -0,0 +1,3 @@
|
|||
indent_type = "Spaces"
|
||||
indent_width = 2
|
||||
column_width = 120
|
Loading…
Reference in a new issue