Compare commits

...

18 Commits

Author SHA1 Message Date
Andy Teijelo b883b4be2c Add vim-visual-multi 2023-06-09 20:13:07 -04:00
Andy Teijelo 1800e5d2e1 Fix indent, remove yaml key order warning 2023-06-09 11:20:30 -04:00
Andy Teijelo b286bcaa74 search visual selection 2023-06-09 08:10:32 -04:00
Andy Teijelo 6e103f4bff More updates 2023-06-08 16:38:02 -04:00
Andy Teijelo bd5bf2bfce A lot of changes 2023-06-08 14:34:13 -04:00
Andy Teijelo 6493b784fb Set conceallevel to 0 in help files 2023-05-31 09:48:55 -04:00
Andy Teijelo 49cbf0f241 Still trying to make LazyVim work for me 2023-05-31 09:37:18 -04:00
Andy Teijelo a1e95f462a wip 2023-05-25 21:01:38 -04:00
Andy Teijelo ef84dd7069 Still trying to get LazyVim to match basic-ide 2023-05-20 13:27:54 -04:00
Andy Teijelo 2a9cc31e40 Updated plugins 2023-05-16 17:01:20 -04:00
Andy Teijelo 26c3931937 wip 2023-03-14 20:52:03 -04:00
Andy Teijelo a707db0529 disable update notification 2023-03-14 20:27:41 -04:00
Andy Teijelo c1dbb28eac wip 2023-03-14 14:32:18 -04:00
Andy Teijelo 51e79ef80d wip 2023-03-14 13:29:39 -04:00
Andy Teijelo b812bb555d making progress in lazyvim 2023-03-13 21:15:17 -04:00
Andy Teijelo 40b335f69a Disable more plugins 2023-03-09 15:08:41 -05:00
Andy Teijelo 4a54404954 disable some plugins 2023-03-09 12:43:06 -05:00
Andy Teijelo 7ad1a4d995 Trying LazyVim 2023-03-08 14:51:50 -05:00
49 changed files with 607 additions and 1614 deletions

53
.gitignore vendored
View File

@ -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 100644
View File

@ -0,0 +1,15 @@
{
"neodev": {
"library": {
"enabled": true,
"plugins": true
}
},
"neoconf": {
"plugins": {
"lua_ls": {
"enabled": true
}
}
}
}

View File

@ -0,0 +1 @@
vim.opt_local.conceallevel = 0

View File

@ -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")

49
lazy-lock.json 100644
View File

@ -0,0 +1,49 @@
{
"LazyVim": { "branch": "main", "commit": "7c593dce1f37647fddca3a6b5caaf7a94324a064" },
"LuaSnip": { "branch": "master", "commit": "a13af80734eb28f744de6c875330c9d3c24b5f3b" },
"bufferline.nvim": { "branch": "main", "commit": "02d795081e6a24ec1fd506c513491543793d0780" },
"catppuccin": { "branch": "main", "commit": "233c4175780d9b4e39ae4fe4535c1e4c14bd76ed" },
"cmp-buffer": { "branch": "main", "commit": "3022dbc9166796b644a841a02de8dd1cc1d311fa" },
"cmp-emoji": { "branch": "main", "commit": "19075c36d5820253d32e2478b6aaf3734aeaafa0" },
"cmp-nvim-lsp": { "branch": "main", "commit": "0e6b2ed705ddcff9738ec4ea838141654f12eeef" },
"cmp-path": { "branch": "main", "commit": "91ff86cd9c29299a64f968ebb45846c485725f23" },
"cmp_luasnip": { "branch": "master", "commit": "18095520391186d634a0045dacaa346291096566" },
"fidget.nvim": { "branch": "main", "commit": "0ba1e16d07627532b6cae915cc992ecac249fb97" },
"friendly-snippets": { "branch": "main", "commit": "b471f5419155ce832eff71ad8920ea8cfbd54840" },
"gitsigns.nvim": { "branch": "main", "commit": "4455bb5364d29ff86639dfd5533d4fe4b48192d4" },
"lazy.nvim": { "branch": "main", "commit": "f145e6f42a56306c5536e9efbfe41f7efbec285d" },
"leap.nvim": { "branch": "main", "commit": "14b5a65190fe69388a8f59c695ed3394a10d6af8" },
"lualine.nvim": { "branch": "master", "commit": "05d78e9fd0cdfb4545974a5aa14b1be95a86e9c9" },
"mason-lspconfig.nvim": { "branch": "main", "commit": "5230617372e656d4a2e1e236e03bf7e7b4b97273" },
"mason.nvim": { "branch": "main", "commit": "7d7efc738e08fc5bee822857db45cb6103f0b0c1" },
"mini.ai": { "branch": "main", "commit": "44d7df1340b16b16b27b67fba07028cb57f45408" },
"mini.bufremove": { "branch": "main", "commit": "14805473144fffbd019d07e51bed2d176e065ee9" },
"mini.comment": { "branch": "main", "commit": "877acea5b2a32ff55f808fc0ebe9aa898648318c" },
"mini.nvim": { "branch": "main", "commit": "296ebbbd3e5ba5e43f5125efe18ad76fe3b632cc" },
"mini.surround": { "branch": "main", "commit": "eeaf96562947f75afa51a6266e066529369ca7ef" },
"neo-tree.nvim": { "branch": "v2.x", "commit": "d883632bf8f92f1d5abea4a9c28fb2f90aa795aa" },
"neoconf.nvim": { "branch": "main", "commit": "4cfa8a11e4de565c95636643db77b44f926f4f25" },
"neodev.nvim": { "branch": "main", "commit": "a24a910ad0842be997f34a4811c10b4f92aa53af" },
"nui.nvim": { "branch": "main", "commit": "d5a82aae64426a805e19d8ef5a379292f9dc55d3" },
"null-ls.nvim": { "branch": "main", "commit": "a138b14099e9623832027ea12b4631ddd2a49256" },
"nvim-cmp": { "branch": "main", "commit": "b5a636d46c69bb371995c22d7a10ee1544004879" },
"nvim-lspconfig": { "branch": "master", "commit": "0f598b9ab9f2a6d7e137074be99c8d89af44b990" },
"nvim-navic": { "branch": "master", "commit": "15704c607569d6c5cfeab486d3ef9459645a70ce" },
"nvim-spectre": { "branch": "master", "commit": "1abe23ec9b7bc3082164f4cb842d521ef70e080e" },
"nvim-treesitter": { "branch": "master", "commit": "2c59e0ff3da6514b03d853ebecb6c36c515a5d7d" },
"nvim-treesitter-textobjects": { "branch": "master", "commit": "2d6d3c7e49a24f6ffbbf7898241fefe9784f61bd" },
"nvim-ts-context-commentstring": { "branch": "main", "commit": "0bf8fbc2ca8f8cdb6efbd0a9e32740d7a991e4c3" },
"nvim-web-devicons": { "branch": "master", "commit": "2a125024a137677930efcfdf720f205504c97268" },
"persistence.nvim": { "branch": "main", "commit": "4b8051c01f696d8849a5cb8afa9767be8db16e40" },
"plenary.nvim": { "branch": "master", "commit": "499e0743cf5e8075cd32af68baa3946a1c76adf1" },
"telescope.nvim": { "branch": "master", "commit": "991d5db62451ee7a50944b84aaad4b58c3447b60" },
"todo-comments.nvim": { "branch": "main", "commit": "09b0b17d824d2d56f02ff15967e8a2499a89c731" },
"tokyonight.nvim": { "branch": "main", "commit": "161114bd39b990995e08dbf941f6821afbdcd666" },
"trouble.nvim": { "branch": "main", "commit": "2af0dd9767526410c88c628f1cbfcb6cf22dd683" },
"typescript.nvim": { "branch": "main", "commit": "5b3680e5c386e8778c081173ea0c978c14a40ccb" },
"vim-illuminate": { "branch": "master", "commit": "a2907275a6899c570d16e95b9db5fd921c167502" },
"vim-repeat": { "branch": "master", "commit": "24afe922e6a05891756ecf331f39a1f6743d3d5a" },
"vim-startuptime": { "branch": "master", "commit": "454b3de856b7bd298700de33d79774ca9b9e3875" },
"vim-visual-multi": { "branch": "master", "commit": "724bd53adfbaf32e129b001658b45d4c5c29ca1a" },
"which-key.nvim": { "branch": "main", "commit": "e271c28118998c93a14d189af3395812a1aa646c" }
}

View 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

View File

@ -0,0 +1,213 @@
-- Keymaps are automatically loaded on the VeryLazy event
-- Default keymaps that are always set: https://github.com/LazyVim/LazyVim/blob/main/lua/lazyvim/config/keymaps.lua
-- Add any additional keymaps here
--
-- Shorten function name
local keymap = vim.keymap.set
-- Silent keymap option
local opts = { silent = true }
-- Remap LazyVim
keymap("n", "<Leader>l", "<Nop>", opts)
keymap("n", "<Leader>lz", "<cmd>:Lazy<cr>", { desc = "Lazy" })
-- --Remap space as leader key
-- keymap("", "<Space>", "<Nop>", opts)
-- vim.g.mapleader = " "
--
-- -- Modes
-- -- normal_mode = "n",
-- -- insert_mode = "i",
-- -- visual_mode = "v",
-- -- visual_block_mode = "x",
-- -- term_mode = "t",
-- -- command_mode = "c",
--
-- -- Normal --
-- -- Better window navigation
-- keymap("n", "<C-h>", "<C-w>h", opts)
-- keymap("n", "<C-j>", "<C-w>j", opts)
-- keymap("n", "<C-k>", "<C-w>k", opts)
-- keymap("n", "<C-l>", "<C-w>l", opts)
--
-- -- Resize with arrows
-- keymap("n", "<C-Up>", ":resize -2<CR>", opts)
-- keymap("n", "<C-Down>", ":resize +2<CR>", opts)
-- keymap("n", "<C-Left>", ":vertical resize -2<CR>", opts)
-- keymap("n", "<C-Right>", ":vertical resize +2<CR>", opts)
--
-- Navigate buffers
keymap("n", "<M-l>", ":BufferLineCycleNext<CR>", opts)
keymap("n", "<M-h>", ":BufferLineCyclePrev<CR>", opts)
keymap("i", "<M-l>", ":BufferLineCycleNext<CR>", opts)
keymap("i", "<M-h>", ":BufferLineCyclePrev<CR>", opts)
keymap("x", "<M-l>", ":BufferLineCycleNext<CR>", opts)
keymap("x", "<M-h>", ":BufferLineCyclePrev<CR>", opts)
keymap("n", "<H>", "<Nop>", opts)
keymap("n", "<L>", "<Nop>", opts)
keymap("n", "<M-L>", ":BufferLineMoveNext<CR>", opts)
keymap("n", "<M-H>", ":BufferLineMovePrev<CR>", opts)
for _, mode in ipairs({ "n", "i", "v" }) do
vim.keymap.set(mode, "<A-1>", "<Cmd>BufferLineGoToBuffer 1<CR>", { noremap = true, silent = true })
vim.keymap.set(mode, "<A-2>", "<Cmd>BufferLineGoToBuffer 2<CR>", { noremap = true, silent = true })
vim.keymap.set(mode, "<A-3>", "<Cmd>BufferLineGoToBuffer 3<CR>", { noremap = true, silent = true })
vim.keymap.set(mode, "<A-4>", "<Cmd>BufferLineGoToBuffer 4<CR>", { noremap = true, silent = true })
vim.keymap.set(mode, "<A-5>", "<Cmd>BufferLineGoToBuffer 5<CR>", { noremap = true, silent = true })
end
--
--
-- -- Clear highlights
-- keymap("n", "<leader>h", "<cmd>nohlsearch<CR>", opts)
--
-- Close buffers
keymap("n", "<M-q>", "<cmd>Bdelete<CR>", opts)
keymap("n", "<M-Q>", "<cmd>Bdelete!<CR>", opts)
--
-- -- Better paste
-- keymap("x", "p", '"_dP', opts)
--
-- -- Insert --
-- -- Press jk fast to enter
-- --keymap("i", "jk", "<ESC>", opts)
--
-- -- Visual --
-- -- Stay in indent mode
-- keymap("v", "<", "<gv", opts)
-- keymap("v", ">", ">gv", opts)
--
-- search with '-', for my LatinAmerican layout
keymap("n", "-", "/", opts)
keymap("x", "-", "/", opts)
--
-- -- Plugins --
--
-- NvimTree
-- keymap("n", "<leader>e", ":NvimTreeToggle<CR>", opts)
--
-- -- Telescope
-- keymap("n", "<leader>fa", ":Telescope find_files<CR>", opts)
-- keymap("n", "<leader>ff", ":Telescope git_files<CR>", opts)
-- keymap("n", "<leader>ft", ":Telescope live_grep<CR>", opts)
-- keymap("n", "<leader>fp", ":Telescope projects<CR>", opts)
-- keymap("n", "<leader>fb", ":Telescope buffers<CR>", opts)
-- keymap("n", "<leader>fs", ":Telescope grep_string<CR>", opts)
-- keymap("n", "<leader>fr", ":Telescope oldfiles<CR>", opts)
--
-- -- Git
-- --keymap("n", "<leader>gg", "<cmd>lua _LAZYGIT_TOGGLE()<CR>", opts)
--
-- -- Comment
-- keymap("n", "<leader>/", "<cmd>lua require('Comment.api').toggle_current_linewise()<cr>", opts)
-- keymap("x", "<leader>/", '<esc><cmd>lua require("Comment.api").toggle_linewise_op(vim.fn.visualmode())<cr>')
--
-- -- DAP
-- keymap("n", "<F9>", "<cmd>lua require'dap'.toggle_breakpoint()<cr>", opts)
-- keymap("n", "<F5>", "<cmd>lua require'dap'.continue()<cr>", opts)
-- keymap("n", "<F10>", "<cmd>lua require'dap'.step_over()<cr>", opts)
-- keymap("n", "<F11>", "<cmd>lua require'dap'.step_into()<cr>", opts)
-- keymap("n", "<F23>", "<cmd>lua require'dap'.step_out()<cr>", opts)
-- keymap("n", "<leader>dr", "<cmd>lua require'dap'.repl.toggle()<cr>", opts)
-- keymap("n", "<leader>dl", "<cmd>lua require'dap'.run_last()<cr>", opts)
-- keymap("n", "<leader>du", "<cmd>lua require'dapui'.toggle()<cr>", opts)
-- keymap("n", "<F17>", "<cmd>lua require'dap'.terminate()<cr>", opts) -- Shift+F5
--
-- ---- Vimspector
-- --keymap("n", "<F9>", "<Plug>VimspectorToggleBreakpoint", opts)
-- --keymap("n", "<F5>", "<plug>VimspectorContinue", opts)
-- --keymap("n", "<F10>", "<Plug>VimspectorStepOver", opts)
-- --keymap("n", "<F11>", "<Plug>VimspectorStepInto", opts)
-- --keymap("n", "<F23>", "<Plug>VimspectorStepOut", opts)
-- --keymap("n", "<F17>", "<cmd>VimspectorReset<cr>", opts) -- Shift+F5
-- --keymap("n", "<F41>", "<Plug>VimspectorRestart", opts) -- Ctrl+Shift+F5
-- --keymap("n", "<leader>di", "<Plug>VimspectorBalloonEval", opts)
--
-- -- move.nvim
-- keymap('n', '<M-J>', ':MoveLine(1)<cr>', opts)
-- keymap('n', '<M-K>', ':MoveLine(-1)<cr>', opts)
-- keymap('x', '<M-J>', ':MoveBlock(1)<cr>', opts)
-- keymap('x', '<M-K>', ':MoveBlock(-1)<cr>', opts)
--
-- disable arrow keys
keymap("n", "<Right>", "<Nop>", opts)
keymap("n", "<Left>", "<Nop>", opts)
keymap("n", "<Up>", "<Nop>", opts)
keymap("n", "<Down>", "<Nop>", opts)
keymap("i", "<Right>", "<Nop>", opts)
keymap("i", "<Left>", "<Nop>", opts)
keymap("i", "<Up>", "<Nop>", opts)
keymap("i", "<Down>", "<Nop>", opts)
--
-- -- move through wrapped lines
-- keymap("n", "j", "gj")
-- keymap("n", "k", "gk")
--
-- -- use Alt + ijkl to move in insert mode
-- keymap("i", "<M-l>", "<Right>", opts)
-- keymap("i", "<M-h>", "<Left>", opts)
-- keymap("i", "<M-j>", "<C-o>gj", opts)
-- keymap("i", "<M-k>", "<C-o>gk", opts)
--
-- local function clean_screen()
-- vim.o.number = not vim.o.number;
-- --if not vim.diagnostic.get_next() then return end
-- if vim.o.number then
-- vim.diagnostic.show()
-- vim.opt.signcolumn = "yes"
-- vim.cmd("syntax on")
-- else
-- vim.diagnostic.hide()
-- vim.opt.signcolumn = "no"
-- vim.cmd("syntax off")
-- end
-- end
--
-- keymap("n", "<leader>n", clean_screen, opts)
function vim.getVisualSelection()
vim.cmd('noau normal! "vy"')
local text = vim.fn.getreg('v')
vim.fn.setreg('v', {})
text = string.gsub(text, "\n", "")
if #text > 0 then
return text
else
return ''
end
end
keymap('v', '<space>sw', function()
local tb = require('telescope.builtin')
local text = vim.getVisualSelection()
tb.live_grep({ default_text = text })
end, opts)
--
-- local function otherkeymaps()
-- local ok
-- local wk
-- local gs
-- ok, wk = pcall(require, "which-key")
-- if not ok then
-- return
-- end
-- ok, gs = pcall(require, "gitsigns")
-- if not ok then
-- return
-- end
-- wk.register({
-- g = {
-- name = "gitsigns",
-- p = { "<cmd>Gitsigns preview_hunk<cr>", "Preview hunk" },
-- b = { function() gs.blame_line{full=false} end, "Blame line (short)" },
-- B = { function() gs.blame_line{full=true} end, "Blame line (full)" }
-- },
-- prefix = "<leader>"
-- })
-- end
-- keymap("n", "<leader>lf", "<cmd>lua vim.lsp.buf.format()<cr>", opts)
-- keymap("v", "<leader>lf", "<esc><cmd>'<,'>lua vim.lsp.buf.format{ async = true }<cr>", opts)
-- keymap("x", "<leader>lf", "<esc><cmd>'<,'>lua vim.lsp.buf.format{ async = true }<cr>", opts)
--
-- otherkeymaps()

View File

@ -0,0 +1,51 @@
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",
},
},
},
})

View File

@ -0,0 +1,11 @@
-- 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

View File

@ -0,0 +1,135 @@
local cmp = require("cmp")
local luasnip = require("luasnip")
return {
{
"LazyVim/LazyVim",
opts = {
colorscheme = "catppuccin",
},
},
{
"nvim-lualine/lualine.nvim",
opts = {
sections = {
lualine_z = {},
},
},
},
{
"nvim-neo-tree/neo-tree.nvim",
opts = {
window = {
mappings = {
["l"] = "open",
},
},
},
},
{
"hrsh7th/nvim-cmp",
dependencies = {
"hrsh7th/cmp-emoji",
},
opts = function(_, opts)
local has_words_before = function()
unpack = unpack or table.unpack
local line, col = unpack(vim.api.nvim_win_get_cursor(0))
return col ~= 0 and vim.api.nvim_buf_get_lines(0, line - 1, line, true)[1]:sub(col, col):match("%s") == nil
end
opts.mapping = vim.tbl_extend("force", opts.mapping, {
["<C-k>"] = cmp.mapping.select_prev_item(),
["<C-j>"] = cmp.mapping.select_next_item(),
-- ["<C-b>"] = cmp.mapping(cmp.mapping.scroll_docs(-1), { "i", "c" }),
-- ["<C-f>"] = cmp.mapping(cmp.mapping.scroll_docs(1), { "i", "c" }),
["<C-Space>"] = cmp.mapping(cmp.mapping.complete(), { "i", "c" }),
-- ["<C-e>"] = cmp.mapping({
-- i = cmp.mapping.abort(),
-- c = cmp.mapping.close(),
-- }),
-- Accept currently selected item. If none selected, `select` first item.
-- Set `select` to `false` to only confirm explicitly selected items.
["<CR>"] = cmp.mapping.confirm({ select = false }),
-- ["<Tab>"] = cmp.mapping(function(fallback)
-- if cmp.visible() then
-- cmp.select_next_item()
-- elseif luasnip.expandable() then
-- luasnip.expand()
-- elseif luasnip.expand_or_jumpable() then
-- luasnip.expand_or_jump()
-- elseif check_backspace() then
-- fallback()
-- else
-- fallback()
-- end
-- end, {
-- "i",
-- "s",
-- }),
-- ["<S-Tab>"] = cmp.mapping(function(fallback)
-- if cmp.visible() then
-- cmp.select_prev_item()
-- elseif luasnip.jumpable(-1) then
-- luasnip.jump(-1)
-- else
-- fallback()
-- end
-- end, {
-- "i",
-- "s",
-- }),
["<Tab>"] = cmp.mapping(function(fallback)
if cmp.visible() then
cmp.select_next_item()
-- You could replace the expand_or_jumpable() calls with expand_or_locally_jumpable()
-- this way you will only jump inside the snippet region
elseif luasnip.expand_or_jumpable() then
luasnip.expand_or_jump()
elseif has_words_before() then
cmp.complete()
else
fallback()
end
end, { "i", "s" }),
["<S-Tab>"] = cmp.mapping(function(fallback)
if cmp.visible() then
cmp.select_prev_item()
elseif luasnip.jumpable(-1) then
luasnip.jump(-1)
else
fallback()
end
end, { "i", "s" }),
})
opts.window = {
completion = cmp.config.window.bordered(),
documentation = cmp.config.window.bordered(),
}
opts.preselect = cmp.PreselectMode.None
opts.completion = {
completeopt = "noselect",
}
-- opts.formatting = {
-- fields = { "kind", "abbr", "menu" },
-- -- format = function(entry, vim_item)
-- -- -- vim_item.kind = kind_icons[vim_item.kind]
-- -- vim_item.menu = ({
-- -- nvim_lsp = "",
-- -- nvim_lua = "",
-- -- luasnip = "",
-- -- buffer = "",
-- -- path = "",
-- -- emoji = "",
-- -- })[entry.source.name]
-- -- return vim_item
-- -- end,
-- }
-- opts.confirm_opts = {
-- behavior = cmp.ConfirmBehavior.Replace,
-- select = false,
-- }
end,
},
}

View File

@ -0,0 +1,12 @@
return {
{ "echasnovski/mini.nvim", enabled = true },
{ "echasnovski/mini.pairs", enabled = false },
{ "echasnovski/mini.indentscope", enabled = false },
{ "lukas-reineke/indent-blankline.nvim", enabled = false },
{ "goolord/alpha-nvim", enabled = false },
{ "rcarriga/nvim-notify", enabled = false },
{ "ggandor/flit.nvim", enabled = false },
{ "stevearc/dressing.nvim", enabled = false },
-- { "folke/neodev.nvim", enabled = false },
-- { "nvim-neo-tree/neo-tree.nvim", enabled = false },
}

View File

@ -0,0 +1,9 @@
return {
{
"j-hui/fidget.nvim",
enabled = true,
init = function()
require("fidget").setup()
end,
},
}

View File

@ -0,0 +1,26 @@
return {
{
"neovim/nvim-lspconfig",
init = function()
local format = function()
require("lazyvim.plugins.lsp.format").format({ force = true })
end
local keys = require("lazyvim.plugins.lsp.keymaps").get()
keys[#keys + 1] = { "<leader>lf", format, desc = "Format Document", has = "documentFormatting" }
keys[#keys + 1] = { "<leader>lf", format, desc = "Format Range", mode = "v", has = "documentRangeFormatting" }
end,
opts = {
autoformat = false,
servers = {
yamlls = {
settings = {
yaml = {
keyOrdering = false,
},
},
},
},
},
},
}

View File

@ -0,0 +1,52 @@
return {
"folke/noice.nvim",
enabled = false,
opts = {
cmdline = {
enabled = true,
view = "cmdline",
format = {
cmdline = false,
search_down = false,
search_up = false,
filter = false,
lua = false,
help = false,
},
},
messages = {
enabled = true,
},
popupmenu = {
enabled = false,
backend = "nui",
},
presets = {
bottom_search = true,
command_palette = false,
long_message_to_split = true,
inc_rename = false,
lsp_doc_border = true,
},
lsp = {
progress = {
enabled = true,
},
},
status = {},
-- views = {
-- popupmenu = {
-- relative = "cursor",
-- position = {
-- row = 0,
-- col = 0,
-- },
-- },
-- },
-- routes = {
-- view = "cmdline",
-- filter = {
-- }
-- }
},
}

View File

@ -0,0 +1,8 @@
return {
-- {
-- "nvim-tree/nvim-tree.lua",
-- },
-- {
-- "nvim-tree/nvim-web-devicons",
-- },
}

View File

@ -0,0 +1,9 @@
return {
{
"mg979/vim-visual-multi",
-- enabled = true,
-- init = function()
-- require("fidget").setup()
-- end,
},
}

View File

@ -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)

View File

@ -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,
})

View File

@ -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({}))

View File

@ -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" },
},
},
}

View File

@ -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,
},
})

View File

@ -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

View File

@ -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,
})

View File

@ -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\"}"},
-- }
-- }

View File

@ -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" }
})

View File

@ -1,6 +0,0 @@
local ok, fidget = pcall(require, "fidget")
if not ok then
return
end
fidget.setup()

View File

@ -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
}

View File

@ -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,
}

View File

@ -1,6 +0,0 @@
local status_ok, impatient = pcall(require, "impatient")
if not status_ok then
return
end
impatient.enable_profile()

View File

@ -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",
-- },
--}

View File

@ -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()

View File

@ -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

View File

@ -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")

View File

@ -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

View File

@ -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,
},
}

View File

@ -1,9 +0,0 @@
return {
settings = {
python = {
analysis = {
typeCheckingMode = "on",
},
},
},
}

View File

@ -1,9 +0,0 @@
return {
settings = {
["rust-analyzer"] = {
checkOnSave = {
command = "clippy",
},
},
},
}

View File

@ -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,
},
},
},
}

View File

@ -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" },
},
}

View File

@ -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" },
},
},
},
}

View File

@ -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

View File

@ -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)

View File

@ -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')

View File

@ -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,
},
},
},
}

View File

@ -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

View File

@ -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({})

View File

@ -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
]]

View File

@ -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 100644
View File

@ -0,0 +1,3 @@
indent_type = "Spaces"
indent_width = 2
column_width = 120