Compare commits
No commits in common. "main" and "nvim-basic-ide" have entirely different histories.
main
...
nvim-basic
61 changed files with 1395 additions and 760 deletions
53
.gitignore
vendored
53
.gitignore
vendored
|
@ -1,8 +1,45 @@
|
|||
tt.*
|
||||
.tests
|
||||
doc/tags
|
||||
debug
|
||||
.repro
|
||||
foo.*
|
||||
*.log
|
||||
data
|
||||
# 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/
|
|
@ -1,15 +0,0 @@
|
|||
{
|
||||
"neodev": {
|
||||
"library": {
|
||||
"enabled": true,
|
||||
"plugins": true
|
||||
}
|
||||
},
|
||||
"neoconf": {
|
||||
"plugins": {
|
||||
"lua_ls": {
|
||||
"enabled": true
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,2 +0,0 @@
|
|||
vim.opt.sw=2
|
||||
vim.opt.ts=2
|
|
@ -1 +0,0 @@
|
|||
vim.opt_local.conceallevel = 0
|
|
@ -1,2 +0,0 @@
|
|||
vim.opt.sw=2
|
||||
vim.opt.ts=2
|
|
@ -1,2 +0,0 @@
|
|||
vim.opt.sw=2
|
||||
vim.opt.ts=2
|
32
init.lua
32
init.lua
|
@ -1,7 +1,27 @@
|
|||
-- nvim-linux64/share/nvim/runtime/lua/vim/lsp.lua:354 is setting this keymap
|
||||
-- before my LazyVim keymap.lua, and then it takes priority over my own keymap;
|
||||
-- setting it to anything here prevents that from happening.
|
||||
vim.keymap.set("n", "K", function () end)
|
||||
-- keep these above
|
||||
require "user.options"
|
||||
require "user.keymaps"
|
||||
require "user.plugins"
|
||||
|
||||
-- bootstrap lazy.nvim, LazyVim and your plugins
|
||||
require("config.lazy")
|
||||
--require "user.alpha"
|
||||
require "user.autocommands"
|
||||
require "user.colorscheme"
|
||||
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.impatient"
|
||||
require "user.illuminate"
|
||||
require "user.indentline"
|
||||
require "user.lsp"
|
||||
require "user.dap"
|
||||
|
||||
require "user.exrc"
|
||||
require "user.fidget"
|
||||
|
|
|
@ -1,67 +0,0 @@
|
|||
{
|
||||
"LazyVim": { "branch": "main", "commit": "0137a110c14e1d72b59dbb82ba804b568cdc5b18" },
|
||||
"LuaSnip": { "branch": "master", "commit": "659c4479529a05cc9b05ef762639a09d366cc690" },
|
||||
"SchemaStore.nvim": { "branch": "main", "commit": "dbf93f5074efe788a3c0a80c6680d9b9b64953b2" },
|
||||
"bufferline.nvim": { "branch": "main", "commit": "5cc447cb2b463cb499c82eaeabbed4f5fa6a0a44" },
|
||||
"catppuccin": { "branch": "main", "commit": "637d99e638bc6f1efedac582f6ccab08badac0c6" },
|
||||
"cmp-buffer": { "branch": "main", "commit": "3022dbc9166796b644a841a02de8dd1cc1d311fa" },
|
||||
"cmp-nvim-lsp": { "branch": "main", "commit": "39e2eda76828d88b773cc27a3f61d2ad782c922d" },
|
||||
"cmp-path": { "branch": "main", "commit": "91ff86cd9c29299a64f968ebb45846c485725f23" },
|
||||
"conform.nvim": { "branch": "master", "commit": "023f795dbcf32d4351b6a9ed2e613d471b5bb812" },
|
||||
"crates.nvim": { "branch": "main", "commit": "8bf8358ee326d5d8c11dcd7ac0bcc9ff97dbc785" },
|
||||
"dressing.nvim": { "branch": "master", "commit": "fc78a3ca96f4db9f8893bb7e2fd9823e0780451b" },
|
||||
"friendly-snippets": { "branch": "main", "commit": "de8fce94985873666bd9712ea3e49ee17aadb1ed" },
|
||||
"gitsigns.nvim": { "branch": "main", "commit": "9521fe8be39255b9abc6ec54e352bf04c410f5cf" },
|
||||
"grug-far.nvim": { "branch": "main", "commit": "9a2f78219390b47d67795ab09390d7f092e23976" },
|
||||
"indent-blankline.nvim": { "branch": "master", "commit": "7871a88056f7144defca9c931e311a3134c5d509" },
|
||||
"lazy.nvim": { "branch": "main", "commit": "7967abe55752aa90532e6bb4bd4663fe27a264cb" },
|
||||
"lazydev.nvim": { "branch": "main", "commit": "d5800897d9180cea800023f2429bce0a94ed6064" },
|
||||
"lsp_signature.nvim": { "branch": "master", "commit": "fc38521ea4d9ec8dbd4c2819ba8126cea743943b" },
|
||||
"lualine.nvim": { "branch": "master", "commit": "2a5bae925481f999263d6f5ed8361baef8df4f83" },
|
||||
"luvit-meta": { "branch": "main", "commit": "ce76f6f6cdc9201523a5875a4471dcfe0186eb60" },
|
||||
"mason-lspconfig.nvim": { "branch": "main", "commit": "4d0e5b49363cac187326998b96aa6a2884e0e89b" },
|
||||
"mason-nvim-dap.nvim": { "branch": "main", "commit": "8b9363d83b5d779813cdd2819b8308651cec2a09" },
|
||||
"mason.nvim": { "branch": "main", "commit": "e2f7f9044ec30067bc11800a9e266664b88cda22" },
|
||||
"mini.ai": { "branch": "main", "commit": "31c149067d38b97720d2a179619f7745a0006ecc" },
|
||||
"mini.icons": { "branch": "main", "commit": "54686be7d58807906cb2c8c2216e0bf9c044f19a" },
|
||||
"mini.indentscope": { "branch": "main", "commit": "da9af64649e114aa79480c238fd23f6524bc0903" },
|
||||
"mini.nvim": { "branch": "main", "commit": "7b4d5d48b6b5a75009d63f8f3e4ef4819b7e8139" },
|
||||
"mini.surround": { "branch": "main", "commit": "48a9795c9d352c771e1ab5dedab6063c0a2df037" },
|
||||
"neo-tree.nvim": { "branch": "main", "commit": "80dc74d081823649809f78370fa5b204aa9a853a" },
|
||||
"noice.nvim": { "branch": "main", "commit": "ca2e3fea9fb080dcb79d9129d73dac631294fe79" },
|
||||
"nui.nvim": { "branch": "main", "commit": "b58e2bfda5cea347c9d58b7f11cf3012c7b3953f" },
|
||||
"nvim-ansible": { "branch": "main", "commit": "44dabdaa8a9193b7f564a8408ed6d7107705030a" },
|
||||
"nvim-cmp": { "branch": "main", "commit": "f17d9b4394027ff4442b298398dfcaab97e40c4f" },
|
||||
"nvim-dap": { "branch": "master", "commit": "6bf4de67dbe90271608e1c81797e5edc79ec6335" },
|
||||
"nvim-dap-python": { "branch": "master", "commit": "3e3dd98d4d83715c9e0e429b4a5da7bd706e6ceb" },
|
||||
"nvim-dap-ui": { "branch": "master", "commit": "ffa89839f97bad360e78428d5c740fdad9a0ff02" },
|
||||
"nvim-dap-virtual-text": { "branch": "master", "commit": "76d80c3d171224315b61c006502a1e30c213a9ab" },
|
||||
"nvim-lint": { "branch": "master", "commit": "36da8dd0ddc4f88e0beae234c20e75397326f143" },
|
||||
"nvim-lspconfig": { "branch": "master", "commit": "d2d153a179ed59aa7134d7ebdf4d7dcb156efa22" },
|
||||
"nvim-nio": { "branch": "master", "commit": "a428f309119086dc78dd4b19306d2d67be884eee" },
|
||||
"nvim-notify": { "branch": "master", "commit": "fbef5d32be8466dd76544a257d3f3dce20082a07" },
|
||||
"nvim-snippets": { "branch": "main", "commit": "56b4052f71220144689caaa2e5b66222ba5661eb" },
|
||||
"nvim-treesitter": { "branch": "master", "commit": "6389ceb1758b8f62a15194e3b790e33268304cb8" },
|
||||
"nvim-treesitter-context": { "branch": "master", "commit": "158377d700596367a91ea41818f76abdbf75a232" },
|
||||
"nvim-treesitter-textobjects": { "branch": "master", "commit": "3e450cd85243da99dc23ebbf14f9c70e9a0c26a4" },
|
||||
"nvim-ts-autotag": { "branch": "main", "commit": "e239a560f338be31337e7abc3ee42515daf23f5e" },
|
||||
"persistence.nvim": { "branch": "main", "commit": "f6aad7dde7fcf54148ccfc5f622c6d5badd0cc3d" },
|
||||
"plenary.nvim": { "branch": "master", "commit": "2d9b06177a975543726ce5c73fca176cedbffe9d" },
|
||||
"repolink.nvim": { "branch": "master", "commit": "55edfedbaef3e894d2ab5107ea7fadc64cb8258d" },
|
||||
"rustaceanvim": { "branch": "master", "commit": "8ece53be36515cb9e76f3d03511643636469502d" },
|
||||
"snacks.nvim": { "branch": "main", "commit": "14c787540828946126f2acb5e542dc57956c2711" },
|
||||
"tailwindcss-colorizer-cmp.nvim": { "branch": "main", "commit": "3d3cd95e4a4135c250faf83dd5ed61b8e5502b86" },
|
||||
"telescope-fzf-native.nvim": { "branch": "main", "commit": "cf48d4dfce44e0b9a2e19a008d6ec6ea6f01a83b" },
|
||||
"telescope-terraform-doc.nvim": { "branch": "main", "commit": "28efe1f3cb2ed4c83fa69000ae8afd2f85d62826" },
|
||||
"telescope-terraform.nvim": { "branch": "main", "commit": "072c97023797ca1a874668aaa6ae0b74425335df" },
|
||||
"telescope.nvim": { "branch": "master", "commit": "85922dde3767e01d42a08e750a773effbffaea3e" },
|
||||
"todo-comments.nvim": { "branch": "main", "commit": "ae0a2afb47cf7395dc400e5dc4e05274bf4fb9e0" },
|
||||
"tokyonight.nvim": { "branch": "main", "commit": "9758827c3b380ba89da4a2212b6255d01afbcf08" },
|
||||
"trouble.nvim": { "branch": "main", "commit": "3dc00c0447c016cd43e03054c3d49436a1f2076d" },
|
||||
"ts-comments.nvim": { "branch": "main", "commit": "2002692ad1d3f6518d016550c20c2a890f0cbf0e" },
|
||||
"venv-selector.nvim": { "branch": "regexp", "commit": "e82594274bf7b54387f9a2abe65f74909ac66e97" },
|
||||
"vim-bbye": { "branch": "master", "commit": "25ef93ac5a87526111f43e5110675032dbcacf56" },
|
||||
"vim-helm": { "branch": "master", "commit": "ae1ebc160d2b9b90108477ab10df7a4fc501e358" },
|
||||
"vim-visual-multi": { "branch": "master", "commit": "a6975e7c1ee157615bbc80fc25e4392f71c344d4" },
|
||||
"which-key.nvim": { "branch": "main", "commit": "68e37e12913a66b60073906f5d3f14dee0de19f2" }
|
||||
}
|
25
lazyvim.json
25
lazyvim.json
|
@ -1,25 +0,0 @@
|
|||
{
|
||||
"extras": [
|
||||
"lazyvim.plugins.extras.coding.mini-surround",
|
||||
"lazyvim.plugins.extras.dap.core",
|
||||
"lazyvim.plugins.extras.formatting.black",
|
||||
"lazyvim.plugins.extras.formatting.prettier",
|
||||
"lazyvim.plugins.extras.lang.ansible",
|
||||
"lazyvim.plugins.extras.lang.docker",
|
||||
"lazyvim.plugins.extras.lang.helm",
|
||||
"lazyvim.plugins.extras.lang.json",
|
||||
"lazyvim.plugins.extras.lang.python",
|
||||
"lazyvim.plugins.extras.lang.rust",
|
||||
"lazyvim.plugins.extras.lang.tailwind",
|
||||
"lazyvim.plugins.extras.lang.terraform",
|
||||
"lazyvim.plugins.extras.lang.toml",
|
||||
"lazyvim.plugins.extras.lang.typescript",
|
||||
"lazyvim.plugins.extras.lang.yaml",
|
||||
"lazyvim.plugins.extras.ui.mini-indentscope",
|
||||
"lazyvim.plugins.extras.ui.treesitter-context"
|
||||
],
|
||||
"news": {
|
||||
"NEWS.md": "7107"
|
||||
},
|
||||
"version": 7
|
||||
}
|
|
@ -1,16 +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
|
||||
|
||||
-- stop snippets when you leave to normal mode
|
||||
vim.api.nvim_create_autocmd({ "ModeChanged" }, {
|
||||
callback = function()
|
||||
if
|
||||
((vim.v.event.old_mode == "s" and vim.v.event.new_mode == "n") or vim.v.event.old_mode == "i")
|
||||
and require("luasnip").session.current_nodes[vim.api.nvim_get_current_buf()]
|
||||
and not require("luasnip").session.jump_active
|
||||
then
|
||||
require("luasnip").unlink_current()
|
||||
end
|
||||
end,
|
||||
})
|
|
@ -1,129 +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" })
|
||||
|
||||
-- Navigate buffers
|
||||
for _, mode in ipairs({ "n", "i", "x" }) do
|
||||
keymap(mode, "<M-l>", "<cmd>BufferLineCycleNext<CR>", opts)
|
||||
keymap(mode, "<M-h>", "<cmd>BufferLineCyclePrev<CR>", opts)
|
||||
end
|
||||
|
||||
keymap("n", "<H>", "<Nop>", opts)
|
||||
keymap("n", "<L>", "<Nop>", opts)
|
||||
keymap("n", "<M-L>", ":BufferLineMoveNext<CR>", opts)
|
||||
keymap("n", "<M-H>", ":BufferLineMovePrev<CR>", opts)
|
||||
|
||||
function go_to_buffer(buffer)
|
||||
return function()
|
||||
require("bufferline").go_to(buffer, true)
|
||||
end
|
||||
end
|
||||
|
||||
for _, mode in ipairs({ "n", "i", "v" }) do
|
||||
for i = 1, 8 do
|
||||
vim.keymap.set(mode, "<A-" .. i .. ">", go_to_buffer(i), { noremap = true, silent = true })
|
||||
end
|
||||
vim.keymap.set(mode, "<A-9>", go_to_buffer(-1), { 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)
|
||||
|
||||
-- search with '-', for my LatinAmerican layout
|
||||
keymap("n", "-", "/", opts)
|
||||
keymap("x", "-", "/", 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)
|
||||
|
||||
local function clean_screen()
|
||||
vim.o.number = not vim.o.number
|
||||
if vim.o.number then
|
||||
if vim.diagnostic.get_next() then
|
||||
pcall(vim.diagnostic.show)
|
||||
end
|
||||
vim.opt.signcolumn = "yes"
|
||||
vim.g.miniindentscope_disable = false
|
||||
MiniIndentscope.draw()
|
||||
vim.cmd("syntax on")
|
||||
vim.cmd("IBLEnable")
|
||||
else
|
||||
MiniIndentscope.undraw()
|
||||
vim.g.miniindentscope_disable = true
|
||||
if vim.diagnostic.get_next() then
|
||||
vim.diagnostic.hide()
|
||||
end
|
||||
vim.opt.signcolumn = "no"
|
||||
vim.cmd("syntax off")
|
||||
vim.cmd("IBLDisable")
|
||||
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("n", "<leader>ghl", "<cmd>RepoLink<CR>", opts)
|
||||
keymap("x", "<leader>ghl", ":RepoLink<CR>", opts)
|
||||
|
||||
keymap("v", "<space>sw", function()
|
||||
local tb = require("telescope.builtin")
|
||||
local text = vim.getVisualSelection()
|
||||
tb.live_grep({ default_text = text })
|
||||
end, opts)
|
||||
|
||||
keymap("n", "<S-ScrollWheelDown>", "5zl")
|
||||
keymap("n", "<S-ScrollWheelUp>", "5zh")
|
||||
keymap("i", "<S-ScrollWheelDown>", "5zl")
|
||||
keymap("i", "<S-ScrollWheelUp>", "5zh")
|
||||
keymap("x", "<S-ScrollWheelDown>", "5zl")
|
||||
keymap("x", "<S-ScrollWheelUp>", "5zh")
|
||||
|
||||
keymap("n", "<leader>j", vim.diagnostic.goto_next, opts)
|
||||
keymap("n", "<leader>k", vim.diagnostic.goto_prev, opts)
|
||||
|
||||
keymap("n", "<F9>", "<cmd>DapToggleBreakpoint<CR>")
|
||||
keymap("n", "<F5>", "<cmd>DapContinue<CR>")
|
||||
keymap("n", "<F10>", "<cmd>DapStepOver<CR>")
|
||||
keymap("n", "<F11>", "<cmd>DapStepInto<CR>")
|
||||
keymap("n", "<S-F11>", "<cmd>DapStepOut<CR>")
|
||||
|
||||
vim.keymap.set("n", "K", require("noice.lsp").hover, { noremap = true, silent = true })
|
||||
|
||||
local function dismiss_notifications()
|
||||
-- require("notify").dismiss({ silent = true, pending = true })
|
||||
Snacks.notifier.hide()
|
||||
vim.cmd("noh")
|
||||
end
|
||||
vim.keymap.set("n", "<Esc>", dismiss_notifications, { desc = "Dismiss notifications" })
|
|
@ -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,45 +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
|
||||
vim.g.autoformat = false
|
||||
vim.opt.completeopt = "menuone,noselect,preview"
|
||||
vim.opt.foldmethod = "expr"
|
||||
vim.opt.foldexpr = "nvim_treesitter#foldexpr()"
|
||||
vim.opt.foldenable = false
|
||||
vim.opt.exrc = true
|
||||
vim.opt.ttimeoutlen = 0
|
||||
vim.opt.termsync = false
|
||||
|
||||
-- local osc52 = require("vim.ui.clipboard.osc52")
|
||||
--
|
||||
-- vim.g.clipboard = {
|
||||
-- name = "OSC 52",
|
||||
-- copy = {
|
||||
-- ["+"] = function(lines)
|
||||
-- vim.g._clipboard = lines
|
||||
-- osc52.copy("+")(lines)
|
||||
-- end,
|
||||
-- ["*"] = function(lines)
|
||||
-- vim.g._clipboard = lines
|
||||
-- osc52.copy("*")(lines)
|
||||
-- end,
|
||||
-- },
|
||||
-- paste = {
|
||||
-- -- ['+'] = require('vim.ui.clipboard.osc52').paste('+'),
|
||||
-- -- ['*'] = require('vim.ui.clipboard.osc52').paste('*'),
|
||||
-- ["+"] = function()
|
||||
-- return vim.g._clipboard
|
||||
-- end,
|
||||
-- ["*"] = function()
|
||||
-- return vim.g._clipboard
|
||||
-- end,
|
||||
-- },
|
||||
-- }
|
|
@ -1,5 +0,0 @@
|
|||
return {
|
||||
{
|
||||
"moll/vim-bbye",
|
||||
},
|
||||
}
|
|
@ -1,24 +0,0 @@
|
|||
return {
|
||||
-- {
|
||||
-- "catppuccin/nvim",
|
||||
-- name = "catppuccin",
|
||||
-- dependencies = {
|
||||
-- "mg979/vim-visual-multi",
|
||||
-- },
|
||||
-- priority = 1000,
|
||||
-- config = function()
|
||||
-- require("catppuccin").setup({
|
||||
-- custom_highlights = function(colors)
|
||||
-- print("fuuuuuuuuuuuuuuuuuuuck", colors.red)
|
||||
-- return {
|
||||
-- TreesitterContext = { bg = colors.mantle },
|
||||
-- TreesitterContextLineNumber = { bg = colors.mantle },
|
||||
-- TreesitterContextBottom = { style = { "underline" } },
|
||||
-- MultiCursor = { bg = colors.red },
|
||||
-- VM_Cursor = { bg = colors.red },
|
||||
-- }
|
||||
-- end,
|
||||
-- })
|
||||
-- end,
|
||||
-- },
|
||||
}
|
|
@ -1,108 +0,0 @@
|
|||
-- local cmp = require("cmp")
|
||||
|
||||
return {
|
||||
{
|
||||
"folke/which-key.nvim",
|
||||
opts = {
|
||||
win = {
|
||||
border = "single",
|
||||
},
|
||||
delay = 1000,
|
||||
},
|
||||
},
|
||||
{
|
||||
"LazyVim/LazyVim",
|
||||
opts = {
|
||||
colorscheme = "catppuccin",
|
||||
},
|
||||
},
|
||||
{
|
||||
"nvim-lualine/lualine.nvim",
|
||||
opts = {
|
||||
sections = {
|
||||
lualine_z = {},
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
"L3MON4D3/LuaSnip",
|
||||
dependencies = { "rafamadriz/friendly-snippets" },
|
||||
opts = {
|
||||
region_check_events = "CursorHold,InsertLeave",
|
||||
delete_check_events = "TextChanged,InsertEnter,InsertLeave",
|
||||
},
|
||||
},
|
||||
{
|
||||
"hrsh7th/nvim-cmp",
|
||||
-- dependencies = {
|
||||
-- "hrsh7th/cmp-emoji",
|
||||
-- },
|
||||
--@param opts cmp.ConfigSchema
|
||||
opts = function(_, opts)
|
||||
local cmp = require("cmp")
|
||||
local luasnip = require("luasnip")
|
||||
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.sources = cmp.config.sources(vim.list_extend(opts.sources, { { name = "emoji" } }))
|
||||
opts.window = {
|
||||
completion = cmp.config.window.bordered(),
|
||||
documentation = cmp.config.window.bordered(),
|
||||
}
|
||||
opts.formatting = {
|
||||
format = function(entry, vim_item)
|
||||
vim_item.abbr = string.sub(vim_item.abbr, 1, 40)
|
||||
return vim_item
|
||||
end,
|
||||
}
|
||||
opts.preselect = cmp.PreselectMode.None
|
||||
opts.completion = {
|
||||
completeopt = "menuone,noselect,preview",
|
||||
}
|
||||
opts.mapping = cmp.mapping.preset.insert({
|
||||
["<C-n>"] = cmp.mapping.select_next_item({ behavior = cmp.SelectBehavior.Insert }),
|
||||
["<C-p>"] = cmp.mapping.select_prev_item({ behavior = cmp.SelectBehavior.Insert }),
|
||||
["<C-b>"] = cmp.mapping.scroll_docs(-4),
|
||||
["<C-f>"] = cmp.mapping.scroll_docs(4),
|
||||
["<C-Space>"] = cmp.mapping.complete(),
|
||||
["<C-e>"] = cmp.mapping.abort(),
|
||||
["<CR>"] = cmp.mapping.confirm({ select = false }), -- Accept currently selected item. Set `select` to `false` to only confirm explicitly selected items.
|
||||
-- ["<CR>"] = cmp.config.disable,
|
||||
["<S-CR>"] = cmp.mapping.confirm({
|
||||
behavior = cmp.ConfirmBehavior.Replace,
|
||||
select = true,
|
||||
}), -- Accept currently selected item. Set `select` to `false` to only confirm explicitly selected items.
|
||||
["<C-CR>"] = function(fallback)
|
||||
cmp.abort()
|
||||
fallback()
|
||||
end,
|
||||
["<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_locally_jumpable() then
|
||||
-- luasnip.expand_or_jump()
|
||||
elseif luasnip.expandable() then
|
||||
luasnip.expand()
|
||||
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.in_snippet() and luasnip.jumpable(-1) then
|
||||
-- luasnip.jump(-1)
|
||||
else
|
||||
fallback()
|
||||
end
|
||||
end, { "i", "s" }),
|
||||
})
|
||||
end,
|
||||
},
|
||||
}
|
|
@ -1,8 +0,0 @@
|
|||
return {
|
||||
"Saecki/crates.nvim",
|
||||
opts = {
|
||||
popup = {
|
||||
border = "rounded"
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,12 +0,0 @@
|
|||
return {
|
||||
{ "echasnovski/mini.nvim", enabled = true },
|
||||
{ "echasnovski/mini.pairs", enabled = false },
|
||||
{ "echasnovski/mini.bufremove", enabled = false },
|
||||
{ "folke/edgy.nvim", enabled = false },
|
||||
{ "folke/flash.nvim", enabled = false },
|
||||
-- { "rcarriga/nvim-notify", enabled = false },
|
||||
{ "goolord/alpha-nvim", enabled = false },
|
||||
{ "ggandor/leap.nvim", enabled = false },
|
||||
{ "ggandor/flit.nvim", enabled = false },
|
||||
{ "nvimdev/dashboard-nvim", enabled = false },
|
||||
}
|
|
@ -1,3 +0,0 @@
|
|||
return {
|
||||
{ "stevearc/dressing.nvim", opts = { input = { insert_only = false } } },
|
||||
}
|
|
@ -1,10 +0,0 @@
|
|||
return {
|
||||
{
|
||||
"j-hui/fidget.nvim",
|
||||
tag = 'legacy',
|
||||
enabled = false,
|
||||
init = function()
|
||||
require("fidget").setup()
|
||||
end,
|
||||
},
|
||||
}
|
|
@ -1,17 +0,0 @@
|
|||
return {
|
||||
-- {
|
||||
-- "vhyrro/luarocks.nvim",
|
||||
-- priority = 1001,
|
||||
-- opts = {
|
||||
-- rocks = { "magick" },
|
||||
-- },
|
||||
-- },
|
||||
-- {
|
||||
-- "3rd/image.nvim",
|
||||
-- dependencies = { "luarocks.nvim" },
|
||||
-- opts = {
|
||||
-- backend = "kitty",
|
||||
-- -- tmux_show_only_in_active_window = true,
|
||||
-- },
|
||||
-- },
|
||||
}
|
|
@ -1,19 +0,0 @@
|
|||
return {
|
||||
{
|
||||
"lukas-reineke/indent-blankline.nvim",
|
||||
opts = {
|
||||
indent = { char = "▏" },
|
||||
},
|
||||
},
|
||||
{
|
||||
"echasnovski/mini.indentscope",
|
||||
opts = {
|
||||
symbol = "▏",
|
||||
-- options = { try_as_border = true },
|
||||
draw = {
|
||||
delay = 0,
|
||||
animation = require("mini.indentscope").gen_animation.none(),
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
|
@ -1,78 +0,0 @@
|
|||
return {
|
||||
{
|
||||
"neovim/nvim-lspconfig",
|
||||
init = function()
|
||||
local format = function()
|
||||
require("lazyvim.util").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" }
|
||||
keys[#keys + 1] = { "K", false } -- su puta madre!
|
||||
vim.diagnostic.config({
|
||||
float = { border = "rounded" },
|
||||
})
|
||||
end,
|
||||
opts = {
|
||||
diagnostics = {
|
||||
update_in_insert = true,
|
||||
},
|
||||
setup = {
|
||||
-- rust_analyzer = function()
|
||||
-- return true
|
||||
-- end,
|
||||
tsserver = function()
|
||||
return false
|
||||
end,
|
||||
vtsls = function()
|
||||
return true
|
||||
end,
|
||||
},
|
||||
servers = {
|
||||
yamlls = {
|
||||
settings = {
|
||||
yaml = {
|
||||
keyOrdering = false,
|
||||
},
|
||||
},
|
||||
},
|
||||
lua_ls = {
|
||||
root_dir = function()
|
||||
return vim.loop.cwd()
|
||||
end,
|
||||
-- ---@type LazyKeys[]
|
||||
-- keys = {},
|
||||
settings = {
|
||||
Lua = {
|
||||
workspace = {
|
||||
checkThirdParty = false,
|
||||
},
|
||||
completion = {
|
||||
callSnippet = "Replace",
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
vtsls = { enabled = false },
|
||||
tsserver = {
|
||||
enabled = true,
|
||||
settings = {
|
||||
typescript = {
|
||||
inlayHints = {
|
||||
includeInlayEnumMemberValueHints = true,
|
||||
includeInlayFunctionLikeReturnTypeHints = true,
|
||||
includeInlayFunctionParameterTypeHints = true,
|
||||
includeInlayParameterNameHints = "literals",
|
||||
includeInlayParameterNameHintsWhenArgumentMatchesName = false,
|
||||
includeInlayPropertyDeclarationTypeHints = true,
|
||||
includeInlayVariableTypeHints = false,
|
||||
includeInlayVariableTypeHintsWhenTypeMatchesName = false,
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
|
@ -1,6 +0,0 @@
|
|||
return {
|
||||
{
|
||||
"ray-x/lsp_signature.nvim",
|
||||
enabled = true,
|
||||
},
|
||||
}
|
|
@ -1,13 +0,0 @@
|
|||
return {
|
||||
{
|
||||
"nvim-neo-tree/neo-tree.nvim",
|
||||
opts = {
|
||||
window = {
|
||||
mappings = {
|
||||
["l"] = "open", -- open folders and files with l
|
||||
},
|
||||
},
|
||||
use_popups_for_input = false,
|
||||
},
|
||||
},
|
||||
}
|
|
@ -1,46 +0,0 @@
|
|||
return {
|
||||
"folke/noice.nvim",
|
||||
-- commit = "d9328ef",
|
||||
enabled = true,
|
||||
opts = {
|
||||
cmdline = {
|
||||
view = "cmdline",
|
||||
format = {
|
||||
cmdline = { pattern = "^:", icon = ":", lang = "vim" },
|
||||
},
|
||||
},
|
||||
views = {
|
||||
hover = {
|
||||
border = { style = "rounded" },
|
||||
-- size = { max_width = 20 },
|
||||
},
|
||||
},
|
||||
presets = {
|
||||
bottom_search = true,
|
||||
command_palette = false,
|
||||
long_message_to_split = true,
|
||||
lsp_doc_border = true,
|
||||
},
|
||||
routes = {
|
||||
{
|
||||
filter = {
|
||||
event = "notify",
|
||||
find = "Request textDocument/inlayHint failed",
|
||||
},
|
||||
opts = { skip = true },
|
||||
},
|
||||
{
|
||||
filter = {
|
||||
event = "notify",
|
||||
find = "Debug Failure. False expression",
|
||||
},
|
||||
opts = { skip = true },
|
||||
},
|
||||
},
|
||||
-- lsp = {
|
||||
-- progress = {
|
||||
-- enabled = false
|
||||
-- }
|
||||
-- },
|
||||
},
|
||||
}
|
|
@ -1,10 +0,0 @@
|
|||
return {
|
||||
{
|
||||
"rcarriga/nvim-notify",
|
||||
opts = {
|
||||
-- stages = "fade_in_slide_out",
|
||||
stages = "static",
|
||||
-- render = "compact",
|
||||
},
|
||||
},
|
||||
}
|
|
@ -1,9 +0,0 @@
|
|||
return {
|
||||
{
|
||||
"9seconds/repolink.nvim",
|
||||
opts = {
|
||||
use_full_commit_hash = true,
|
||||
bang_register = "+",
|
||||
}
|
||||
},
|
||||
}
|
|
@ -1,12 +0,0 @@
|
|||
return {
|
||||
-- {
|
||||
-- "jose-elias-alvarez/typescript.nvim",
|
||||
-- opts = {
|
||||
-- init_options = {
|
||||
-- preferences = {
|
||||
-- importModuleSpecifierPreference = "relative",
|
||||
-- },
|
||||
-- },
|
||||
-- },
|
||||
-- },
|
||||
}
|
|
@ -1,8 +0,0 @@
|
|||
return {
|
||||
{
|
||||
"mg979/vim-visual-multi",
|
||||
init = function()
|
||||
vim.g.VM_theme = "olive"
|
||||
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)
|
71
lua/user/autocommands.lua
Normal file
71
lua/user/autocommands.lua
Normal file
|
@ -0,0 +1,71 @@
|
|||
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 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")
|
||||
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" },
|
||||
},
|
||||
},
|
||||
}
|
128
lua/user/cmp.lua
Normal file
128
lua/user/cmp.lua
Normal file
|
@ -0,0 +1,128 @@
|
|||
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 = "",
|
||||
}
|
||||
|
||||
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 = true }),
|
||||
["<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,
|
||||
},
|
||||
})
|
17
lua/user/colorscheme.lua
Normal file
17
lua/user/colorscheme.lua
Normal file
|
@ -0,0 +1,17 @@
|
|||
--require("catppuccin").setup()
|
||||
--vim.cmd [[colorscheme catppuccin]]
|
||||
|
||||
--TokyonNight
|
||||
--local colorscheme = "tokyonight-night"
|
||||
|
||||
--Catppuccin
|
||||
vim.g.catppuccin_flavour = "mocha" -- latte, frappe, macchiato, mocha
|
||||
local colorscheme = "catppuccin"
|
||||
|
||||
--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()
|
36
lua/user/gitsigns.lua
Normal file
36
lua/user/gitsigns.lua
Normal file
|
@ -0,0 +1,36 @@
|
|||
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,
|
||||
},
|
||||
}
|
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 = 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",
|
||||
-- },
|
||||
--}
|
99
lua/user/keymaps.lua
Normal file
99
lua/user/keymaps.lua
Normal file
|
@ -0,0 +1,99 @@
|
|||
-- 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", "<S-l>", ":bnext<CR>", opts)
|
||||
keymap("n", "<S-h>", ":bprevious<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", "<S-q>", "<cmd>Bdelete<CR>", opts)
|
||||
keymap("n", "<S-q>", "<cmd>Bdelete!<CR>", opts)
|
||||
|
||||
-- Better paste
|
||||
keymap("v", "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)
|
||||
|
||||
-- Plugins --
|
||||
|
||||
-- NvimTree
|
||||
keymap("n", "<leader>e", ":NvimTreeToggle<CR>", opts)
|
||||
|
||||
-- Telescope
|
||||
keymap("n", "<leader>ff", ":Telescope find_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)
|
||||
|
||||
-- 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)
|
97
lua/user/lsp/handlers.lua
Normal file
97
lua/user/lsp/handlers.lua
Normal file
|
@ -0,0 +1,97 @@
|
|||
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", "<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 == "sumneko_lua" 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")
|
54
lua/user/lsp/mason.lua
Normal file
54
lua/user/lsp/mason.lua
Normal file
|
@ -0,0 +1,54 @@
|
|||
local servers = {
|
||||
"sumneko_lua",
|
||||
"cssls",
|
||||
"html",
|
||||
"tsserver",
|
||||
"pyright",
|
||||
"bashls",
|
||||
"jsonls",
|
||||
"yamlls",
|
||||
"rust_analyzer",
|
||||
"gopls"
|
||||
}
|
||||
|
||||
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
|
24
lua/user/lsp/null-ls.lua
Normal file
24
lua/user/lsp/null-ls.lua
Normal file
|
@ -0,0 +1,24 @@
|
|||
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.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",
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
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,
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
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 = 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" },
|
||||
},
|
||||
}
|
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 = false -- 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
|
123
lua/user/plugins.lua
Normal file
123
lua/user/plugins.lua
Normal file
|
@ -0,0 +1,123 @@
|
|||
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", commit = "f11fdff7e8b5b415e5ef1837bdcdd37ea6764dda" } -- enable LSP
|
||||
use { "williamboman/mason.nvim", commit = "c2002d7a6b5a72ba02388548cfaf420b864fbc12"}
|
||||
use { "williamboman/mason-lspconfig.nvim", commit = "0051870dd728f4988110a1b2d47f4a4510213e31" }
|
||||
use { "jose-elias-alvarez/null-ls.nvim", commit = "c0c19f32b614b3921e17886c541c13a72748d450" } -- for formatters and linters
|
||||
use { "RRethy/vim-illuminate", commit = "a2e8476af3f3e993bb0d6477438aad3096512e42" }
|
||||
|
||||
-- Telescope
|
||||
use { "nvim-telescope/telescope.nvim", commit = "76ea9a898d3307244dce3573392dcf2cc38f340f" }
|
||||
|
||||
-- Treesitter
|
||||
use {
|
||||
"nvim-treesitter/nvim-treesitter",
|
||||
commit = "8e763332b7bf7b3a426fd8707b7f5aa85823a5ac",
|
||||
}
|
||||
use {
|
||||
"nvim-treesitter/nvim-treesitter-context",
|
||||
commit = "2f9f75d33158c0289c70cc1e0975af9d36ec16b2",
|
||||
}
|
||||
|
||||
-- Git
|
||||
use { "lewis6991/gitsigns.nvim", commit = "f98c85e7c3d65a51f45863a34feb4849c82f240f" }
|
||||
|
||||
-- DAP
|
||||
use { "mfussenegger/nvim-dap", commit = "014ebd53612cfd42ac8c131e6cec7c194572f21d" }
|
||||
use { "rcarriga/nvim-dap-ui", commit = "d76d6594374fb54abf2d94d6a320f3fd6e9bb2f7" }
|
||||
use { "ravenxrz/DAPInstall.nvim", commit = "8798b4c36d33723e7bba6ed6e2c202f84bb300de" }
|
||||
|
||||
use { "MunifTanjim/exrc.nvim" }
|
||||
use { "simrat39/rust-tools.nvim" }
|
||||
use { "mfussenegger/nvim-dap-python" }
|
||||
|
||||
-- VimSpector
|
||||
--use { "puremourning/vimspector" }
|
||||
|
||||
use { "j-hui/fidget.nvim", commit = "2cf9997d3bde2323a1a0934826ec553423005a26" }
|
||||
|
||||
-- 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 = { ".git", "Makefile", "package.json" },
|
||||
})
|
||||
|
||||
local tele_status_ok, telescope = pcall(require, "telescope")
|
||||
if not tele_status_ok then
|
||||
return
|
||||
end
|
||||
|
||||
telescope.load_extension('projects')
|
25
lua/user/telescope.lua
Normal file
25
lua/user/telescope.lua
Normal file
|
@ -0,0 +1,25 @@
|
|||
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,
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
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
|
||||
|
41
lua/user/treesitter.lua
Normal file
41
lua/user/treesitter.lua
Normal file
|
@ -0,0 +1,41 @@
|
|||
local status_ok, _ = pcall(require, "nvim-treesitter")
|
||||
if not status_ok then
|
||||
return
|
||||
end
|
||||
|
||||
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" }, -- list of language that will be disabled
|
||||
},
|
||||
autopairs = {
|
||||
enable = true,
|
||||
},
|
||||
indent = { enable = true, disable = { "python", "css" } },
|
||||
|
||||
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
|
||||
]]
|
|
@ -1,3 +0,0 @@
|
|||
indent_type = "Spaces"
|
||||
indent_width = 2
|
||||
column_width = 120
|
Loading…
Reference in a new issue