Streamlined configuration for lazy and more healthy defaults

This commit is contained in:
Eduardo Cueto-Mendoza 2023-08-30 10:55:40 +01:00
parent 008841b34d
commit 354709d267
20 changed files with 829 additions and 607 deletions

2
.gitignore vendored
View File

@ -1,2 +1,2 @@
*.json *.json
packer_compiled.lua config/*

10
after/plugin/harpoon.lua Normal file
View File

@ -0,0 +1,10 @@
local mark = require("harpoon.mark")
local ui = require("harpoon.ui")
vim.keymap.set("n", "<leader>a", mark.add_file, { desc = "Harpoon: Mark File"})
vim.keymap.set("n", "<C-e>", ui.toggle_quick_menu, { desc = "Toggle Harpoon Menu"})
vim.keymap.set("n", "<C-t>", function() ui.nav_file(1) end)
vim.keymap.set("n", "<C-s>", function() ui.nav_file(2) end)
vim.keymap.set("n", "<C-b>", function() ui.nav_file(3) end)
vim.keymap.set("n", "<C-g>", function() ui.nav_file(4) end)

125
after/plugin/lsp.lua Normal file
View File

@ -0,0 +1,125 @@
local lsp = require('lsp-zero')
lsp.preset("recommended")
lsp.ensure_installed({
'bashls',
'clangd',
'dockerls',
'julials',
'lua_ls',
'ltex',
'pylsp',
'texlab',
'zls'
})
local cmp = require("cmp")
local cmp_select = { behavior = cmp.SelectBehavior.Select }
local cmp_mappings = lsp.defaults.cmp_mappings({
["<C-p>"] = cmp.mapping.select_prev_item(cmp_select),
["<C-n>"] = cmp.mapping.select_next_item(cmp_select),
["<C-y>"] = cmp.mapping.confirm({ select = true }),
["<CR>"] = cmp.mapping.confirm({ select = true }),
['<C-Space>'] = cmp.mapping.complete(),
})
lsp.setup_nvim_cmp({
mapping = cmp_mappings
})
lsp.on_attach(function(client, bufnr)
local opts = { buffer = bufnr, remap = false }
vim.keymap.set("n", "gr", function() vim.lsp.buf.references() end, opts, { desc = "LSP Goto Reference"})
vim.keymap.set("n", "gd", function() vim.lsp.buf.definition() end, opts, { desc = "LSP Goto Definition"})
vim.keymap.set("n", "K", function() vim.lsp.buf.hover() end, opts, { desc = "LSP Hover"})
vim.keymap.set("n", "<leader>vws", function() vim.lsp.buf.workspace_symbol() end, opts, { desc = "LSP Workspace Symbol"})
vim.keymap.set("n", "<leader>vd", function() vim.diagnostic.setloclist() end, opts, { desc = "LSP Show Diagnostics"})
vim.keymap.set("n", "[d", function() vim.diagnostic.goto_next() end, opts, { desc = "Next Diagnostic"})
vim.keymap.set("n", "]d", function() vim.diagnostic.goto_prev() end, opts, { desc = "Previous Diagnostic"})
vim.keymap.set("n", "<leader>vca", function() vim.lsp.buf.code_action() end, opts, { desc = "LSP Code Action"})
vim.keymap.set("n", "<leader>vrr", function() vim.lsp.buf.references() end, opts, { desc = "LSP References"})
vim.keymap.set("n", "<leader>vrn", function() vim.lsp.buf.rename() end, opts, { desc = "LSP Rename"})
vim.keymap.set("i", "<C-h>", function() vim.lsp.buf.signature_help() end, opts, { desc = "LSP Signature Help"})
end)
--require('lspconfig').lua_ls.setup(lsp.nvim_lua_ls())
require('lspconfig').lua_ls.setup({
settings = {
Lua = {
runtime = {
-- Tell the language server which version of Lua you're using (most likely LuaJIT in the case of Neovim)
version = 'LuaJIT',
},
diagnostics = {
-- Get the language server to recognize the `vim` global
globals = { 'vim' },
neededFileStatus = {
["codestyle-check"] = "Any",
},
},
workspace = {
-- Make the server aware of Neovim runtime files
library = vim.api.nvim_get_runtime_file("", true),
},
-- Do not send telemetry data containing a randomized but unique identifier
telemetry = {
enable = false,
},
format = {
enable = true,
-- Put format options here
-- NOTE: the value should be STRING!!
defaultConfig = {
indent_style = "space",
indent_size = "4",
}
},
},
},
})
lsp.setup()
local cmp_action = require('lsp-zero').cmp_action()
require('luasnip.loaders.from_vscode').lazy_load()
-- `/` cmdline setup.
cmp.setup.cmdline('/', {
mapping = cmp.mapping.preset.cmdline(),
sources = {
{ name = 'buffer' }
}
})
-- `:` cmdline setup.
cmp.setup.cmdline(':', {
mapping = cmp.mapping.preset.cmdline(),
sources = cmp.config.sources({
{ name = 'path' }
}, {
{
name = 'cmdline',
option = {
ignore_cmds = { 'Man', '!' }
}
}
})
})
cmp.setup({
sources = {
{ name = 'nvim_lsp' },
{ name = 'luasnip', keyword_length = 2 },
{ name = 'buffer', keyword_length = 3 },
{ name = 'path' },
},
mapping = {
['<C-f>'] = cmp_action.luasnip_jump_forward(),
['<C-b>'] = cmp_action.luasnip_jump_backward(),
['<Tab>'] = cmp_action.luasnip_supertab(),
['<S-Tab>'] = cmp_action.luasnip_shift_supertab(),
},
})

59
after/plugin/neoclip.lua Normal file
View File

@ -0,0 +1,59 @@
require('neoclip').setup({
history = 1000,
enable_persistent_history = false,
length_limit = 1048576,
continuous_sync = false,
db_path = vim.fn.stdpath("data") .. "/databases/neoclip.sqlite3",
filter = nil,
preview = true,
prompt = nil,
default_register = '"',
default_register_macros = 'q',
enable_macro_history = true,
content_spec_column = false,
disable_keycodes_parsing = false,
on_select = {
move_to_front = false,
close_telescope = true,
},
on_paste = {
set_reg = false,
move_to_front = false,
close_telescope = true,
},
on_replay = {
set_reg = false,
move_to_front = false,
close_telescope = true,
},
on_custom_action = {
close_telescope = true,
},
keys = {
telescope = {
i = {
select = '<cr>',
paste = '<c-j>',
paste_behind = '<c-k>',
replay = '<c-q>', -- replay a macro
delete = '<c-d>', -- delete an entry
edit = '<c-e>', -- edit an entry
custom = {},
},
n = {
select = '<cr>',
paste = 'p',
--- It is possible to map to more than one key.
-- paste = { 'p', '<c-p>' },
paste_behind = 'P',
replay = 'q',
delete = 'd',
edit = 'e',
custom = {},
},
},
},
})
vim.keymap.set("n", "<leader>o", "<cmd>Telescope neoclip<CR>", { desc = "Telescope Neoclip"})

17
after/plugin/null-ls.lua Normal file
View File

@ -0,0 +1,17 @@
vim.keymap.set("n", "<leader>l", '<cmd>lua vim.lsp.buf.format()<CR>')
local null_ls = require("null-ls")
null_ls.setup({
sources = {
null_ls.builtins.formatting.stylua,
null_ls.builtins.formatting.prettier,
null_ls.builtins.diagnostics.eslint,
null_ls.builtins.completion.spell,
null_ls.builtins.code_actions.eslint,
null_ls.builtins.diagnostics.jsonlint,
null_ls.builtins.diagnostics.ktlint,
null_ls.builtins.diagnostics.markdownlint,
null_ls.builtins.diagnostics.protoc_gen_lint,
},
})

View File

@ -0,0 +1,38 @@
require("dap-vscode-js").setup({
debugger_path = '/Users/andrew/vscode-js-debug',
adapters = { 'pwa-node', 'pwa-chrome', 'pwa-msedge', 'node-terminal', 'pwa-extensionHost' }, -- which adapters to register in nvim-dap
})
for _, language in ipairs({ "typescript", "javascript", "typescriptreact" }) do
require("dap").configurations[language] = {
{
type = "pwa-node",
request = "launch",
name = "Debug Jest Tests",
-- trace = true, -- include debugger info
runtimeExecutable = "node",
runtimeArgs = {
"./node_modules/jest/bin/jest.js",
"--runInBand",
},
rootPath = "${workspaceFolder}",
cwd = "${workspaceFolder}",
console = "integratedTerminal",
internalConsoleOptions = "neverOpen",
},
{
type = "pwa-node",
request = "launch",
name = "Launch file",
program = "${file}",
cwd = "${workspaceFolder}",
},
{
type = "pwa-node",
request = "attach",
name = "Attach",
processId = require("dap.utils").pick_process,
cwd = "${workspaceFolder}",
},
}
end

13
after/plugin/nvim-ufo.lua Normal file
View File

@ -0,0 +1,13 @@
vim.o.foldcolumn = '1' -- '0' is not bad
vim.o.foldlevel = 99 -- Using ufo provider need a large value, feel free to decrease the value
vim.o.foldlevelstart = 99
vim.o.foldenable = true
vim.keymap.set('n', 'zR', require('ufo').openAllFolds, { desc = "Open all folds"})
vim.keymap.set('n', 'zM', require('ufo').closeAllFolds, { desc = "Close all folds"})
require('ufo').setup({
provider_selector = function(bufnr, filetype, buftype)
return {'treesitter', 'indent'}
end
})

View File

@ -0,0 +1,78 @@
local builtin = require('telescope.builtin')
vim.keymap.set('n', '<leader>ff', builtin.find_files, { desc = "Find Files"})
vim.keymap.set('n', '<leader>fg', "<cmd>lua require('telescope').extensions.live_grep_args.live_grep_args()<CR>", { desc = "Live Grep"})
vim.keymap.set('n', '<leader>fc', '<cmd>lua require("telescope.builtin").live_grep({ glob_pattern = "!{spec,test}"})<CR>', { desc = "Live Grep Code"})
vim.keymap.set('n', '<leader>fb', builtin.buffers, { desc = "Find Buffers"})
vim.keymap.set('n', '<leader>fh', builtin.help_tags, { desc = "Find Help Tags"})
vim.keymap.set('n', '<leader>fs', builtin.lsp_document_symbols, { desc = "Find Symbols"})
vim.keymap.set('n', '<leader>fi', '<cmd>AdvancedGitSearch<CR>', { desc = "AdvancedGitSearch"})
vim.keymap.set('n', '<leader>fo', builtin.oldfiles, { desc = "Find Old Files"})
vim.keymap.set('n', '<leader>fw', builtin.grep_string, { desc = "Find Word under Cursor"})
local telescope = require("telescope")
local telescopeConfig = require("telescope.config")
-- Clone the default Telescope configuration
local vimgrep_arguments = { unpack(telescopeConfig.values.vimgrep_arguments) }
-- I want to search in hidden/dot files.
table.insert(vimgrep_arguments, "--hidden")
-- I don't want to search in the `.git` directory.
table.insert(vimgrep_arguments, "--glob")
table.insert(vimgrep_arguments, "!**/.git/*")
local actions = require "telescope.actions"
telescope.setup({
defaults = {
-- `hidden = true` is not supported in text grep commands.
vimgrep_arguments = vimgrep_arguments,
path_display = { "truncate" },
mappings = {
n = {
["<C-w>"] = actions.send_selected_to_qflist + actions.open_qflist,
},
i = {
["<C-j>"] = actions.cycle_history_next,
["<C-k>"] = actions.cycle_history_prev,
["<C-w>"] = actions.send_selected_to_qflist + actions.open_qflist,
}
},
},
pickers = {
find_files = {
-- `hidden = true` will still show the inside of `.git/` as it's not `.gitignore`d.
find_command = { "rg", "--files", "--hidden", "--glob", "!**/.git/*" },
},
},
extensions = {
undo = {
use_delta = true,
use_custom_command = nil, -- setting this implies `use_delta = false`. Accepted format is: { "bash", "-c", "echo '$DIFF' | delta" }
side_by_side = false,
diff_context_lines = vim.o.scrolloff,
entry_format = "state #$ID, $STAT, $TIME",
mappings = {
i = {
["<C-cr>"] = require("telescope-undo.actions").yank_additions,
["<S-cr>"] = require("telescope-undo.actions").yank_deletions,
["<cr>"] = require("telescope-undo.actions").restore,
},
},
},
}
})
require("telescope").load_extension "neoclip"
require('telescope').load_extension('fzf')
require('telescope').load_extension('ui-select')
vim.g.zoxide_use_select = true
require("telescope").load_extension("undo")
require("telescope").load_extension("advanced_git_search")
require("telescope").load_extension("live_grep_args")

4
init.lua Executable file → Normal file
View File

@ -1 +1,3 @@
require("core") require('eddie.lazy')
require('eddie.remaps')
require('eddie.options')

View File

@ -1,11 +0,0 @@
function ColorMyPencils(color)
color = color or "tokyonight-night"
vim.cmd.colorscheme(color)
--vim.api.nvim_set_hl(0, "Normal", { bg = "none" })
--vim.api.nvim_set_hl(0, "NormalFloat", { bg = "none" })
end
ColorMyPencils()

View File

@ -1,100 +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" },
mappings = {
i = {
["<C-n>"] = actions.cycle_history_next,
["<C-p>"] = actions.cycle_history_prev,
["<C-j>"] = actions.move_selection_next,
["<C-k>"] = actions.move_selection_previous,
["<C-c>"] = actions.close,
["<Down>"] = actions.move_selection_next,
["<Up>"] = actions.move_selection_previous,
["<CR>"] = actions.select_default,
["<C-x>"] = actions.select_horizontal,
["<C-v>"] = actions.select_vertical,
["<C-t>"] = actions.select_tab,
["<C-u>"] = actions.preview_scrolling_up,
["<C-d>"] = actions.preview_scrolling_down,
["<PageUp>"] = actions.results_scrolling_up,
["<PageDown>"] = actions.results_scrolling_down,
["<Tab>"] = actions.toggle_selection + actions.move_selection_worse,
["<S-Tab>"] = actions.toggle_selection + actions.move_selection_better,
["<C-q>"] = actions.send_to_qflist + actions.open_qflist,
["<M-q>"] = actions.send_selected_to_qflist + actions.open_qflist,
["<C-l>"] = actions.complete_tag,
["<C-_>"] = actions.which_key, -- keys from pressing <C-/>
},
n = {
["<esc>"] = actions.close,
["<CR>"] = actions.select_default,
["<C-x>"] = actions.select_horizontal,
["<C-v>"] = actions.select_vertical,
["<C-t>"] = actions.select_tab,
["<Tab>"] = actions.toggle_selection + actions.move_selection_worse,
["<S-Tab>"] = actions.toggle_selection + actions.move_selection_better,
["<C-q>"] = actions.send_to_qflist + actions.open_qflist,
["<M-q>"] = actions.send_selected_to_qflist + actions.open_qflist,
["j"] = actions.move_selection_next,
["k"] = actions.move_selection_previous,
["H"] = actions.move_to_top,
["M"] = actions.move_to_middle,
["L"] = actions.move_to_bottom,
["<Down>"] = actions.move_selection_next,
["<Up>"] = actions.move_selection_previous,
["gg"] = actions.move_to_top,
["G"] = actions.move_to_bottom,
["<C-u>"] = actions.preview_scrolling_up,
["<C-d>"] = actions.preview_scrolling_down,
["<PageUp>"] = actions.results_scrolling_up,
["<PageDown>"] = actions.results_scrolling_down,
["?"] = actions.which_key,
},
},
},
pickers = {
-- Default configuration for builtin pickers goes here:
-- picker_name = {
-- picker_config_key = value,
-- ...
-- }
-- Now the picker_config_key will be applied every time you call this
-- builtin picker
planets = {
show_pluto = true,
},
},
extensions = {
-- Your extension configuration goes here:
-- extension_name = {
-- extension_config_key = value,
-- }
-- please take a look at the readme of the extension you want to configure
},
}

View File

@ -1,3 +0,0 @@
require("core.keymaps")
require("core.options")
require("core.lazy")

View File

@ -1,161 +0,0 @@
local opts = { noremap = true, silent = true }
local term_opts = { silent = true }
-- Shorten function name
local keymap = vim.api.nvim_set_keymap
--Remap space as leader key
keymap("", "<Space>", "<Nop>", opts)
vim.g.mapleader = " "
vim.g.maplocalleader = " "
-- 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)
keymap("n", "<leader>e", ":Lex 30<cr>", 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)
-- Move text up and down
keymap("n", "<A-j>", "<Esc>:m .+1<CR>==gi", opts)
keymap("n", "<A-k>", "<Esc>:m .-2<CR>==gi", opts)
-- Insert --
-- Press jk fast to enter
keymap("i", "jk", "<ESC>", opts)
keymap("i", "kj", "<ESC>", opts)
-- Visual --
-- Stay in indent mode
keymap("v", "<", "<gv", opts)
keymap("v", ">", ">gv", opts)
-- Move text up and down
keymap("v", "<A-j>", ":m .+1<CR>==", opts)
keymap("v", "<A-k>", ":m .-2<CR>==", opts)
keymap("v", "p", '"_dP', opts)
-- Visual Block --
-- Move text up and down
keymap("x", "J", ":move '>+1<CR>gv-gv", opts)
keymap("x", "K", ":move '<-2<CR>gv-gv", opts)
keymap("x", "<A-j>", ":move '>+1<CR>gv-gv", opts)
keymap("x", "<A-k>", ":move '<-2<CR>gv-gv", opts)
-- Terminal --
-- Better terminal navigation
keymap("t", "<C-h>", "<C-\\><C-N><C-w>h", term_opts)
keymap("t", "<C-j>", "<C-\\><C-N><C-w>j", term_opts)
keymap("t", "<C-k>", "<C-\\><C-N><C-w>k", term_opts)
keymap("t", "<C-l>", "<C-\\><C-N><C-w>l", term_opts)
-- keymap("n", "<leader>f", "<cmd>Telescope find_files<cr>", opts)
keymap("n", "<leader>f", "<cmd>lua require'telescope.builtin'.find_files(require('telescope.themes').get_dropdown({ previewer = false }))<cr>", opts)
keymap("n", "<C-g>", "<cmd>Telescope live_grep<cr>", opts)
keymap("n", "<leader>pv", "<cmd>Ex<cr>", opts)
-------------------
---- Normal mode --
-------------------
--local opts = { noremap = true, silent = true }
--
--local term_opts = { silent = true }
--
---- Shorten function name
--local keymap = vim.api.nvim_set_keymap
--
----Remap space as leader key
--keymap("", "<Space>", "<Nop>", opts)
--
---- Hint: see `:h vim.map.set()`
---- Better window navigation
--vim.keymap.set("n", "<C-h>", "<C-w>h", opts)
--vim.keymap.set("n", "<C-j>", "<C-w>j", opts)
--vim.keymap.set("n", "<C-k>", "<C-w>k", opts)
--vim.keymap.set("n", "<C-l>", "<C-w>l", opts)
--
---- Resize with arrows
---- delta: 2 lines
--vim.keymap.set("n", "<C-Up>", ":resize -2<CR>", opts)
--vim.keymap.set("n", "<C-Down>", ":resize +2<CR>", opts)
--vim.keymap.set("n", "<C-Left>", ":vertical resize -2<CR>", opts)
--vim.keymap.set("n", "<C-Right>", ":vertical resize +2<CR>", opts)
--
---- open File Explorer
--vim.keymap.set("n", "<leader>pv", vim.cmd.Ex)
--
---- Navigate buffers
--vim.keymap.set("n", "<BS>", ":bnext<CR>", opts)
--vim.keymap.set("n", "<S-TAB>", ":bprevious<CR>", opts)
--
---- Telescope
----local builtin = require("telescope.builtin")
----vim.keymap.set("n", "<leader>pf", builtin.find_files, {})
----vim.keymap.set("n", "<C-p>", builtin.git_files, {})
----vim.keymap.set("n", "<leader>ps", function ()
---- builtin.grep_string( { search = vim.fn.input("Grep > ") } );
----end)
--
---- Harpoon
----local mark = require("harpoon.mark")
----local ui = require("harpoon.ui")
----vim.keymap.set("n", "<leader>a", mark.add_file)
----vim.keymap.set("n", "<C-e>", ui.toggle_quick_menu)
----
----vim.keymap.set("n", "<C-h>", function () ui.nav_file(1) end)
----vim.keymap.set("n", "<C-t>", function () ui.nav_file(2) end)
----vim.keymap.set("n", "<C-n>", function () ui.nav_file(3) end)
----vim.keymap.set("n", "<C-s>", function () ui.nav_file(4) end)
--
---- Undotree
--vim.keymap.set("n", "<leader>u", vim.cmd.UndotreeToggle)
--
---- Fugitive
--vim.keymap.set("n", "<leader>gs", vim.cmd.Git)
--
---- Put line bellow in-front of line
--vim.keymap.set("n", "J", "mzJ`z")
--
---- Keep cursor in the middle
--vim.keymap.set("n", "<C-d>", "<C-d>zz")
--vim.keymap.set("n", "<C-u>", "<C-u>zz")
--vim.keymap.set("n", "n", "nzzzv")
--vim.keymap.set("n", "N", "Nzzzv")
--
---- Don't loose buffer
--vim.keymap.set("x", "<leader>p", "\"_dP")
--
--
-------------------
---- Visual mode --
-------------------
--
---- Hint: start visual mode with the same area as the previous area and the same mode
--vim.keymap.set("v", "<", "<gv", opts)
--vim.keymap.set("v", ">", ">gv", opts)
--
---- Move text on visual mode
--vim.keymap.set("v", "J", ":m '>+1<CR>gv=gv", opts)
--vim.keymap.set("v", "K", ":m '<-2<CR>gv=gv", opts)

View File

@ -1,176 +0,0 @@
local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
if not vim.loop.fs_stat(lazypath) then
vim.fn.system({
"git",
"clone",
"--filter=blob:none",
"https://github.com/folke/lazy.nvim.git",
"--branch=stable", -- latest stable release
lazypath,
})
end
vim.opt.rtp:prepend(lazypath)
local plugins = {
spec = {
import = "plugins"
},
}
local opts = {
root = vim.fn.stdpath("data") .. "/lazy", -- directory where plugins will be installed
defaults = {
lazy = false, -- should plugins be lazy-loaded?
version = nil,
-- default `cond` you can use to globally disable a lot of plugins
-- when running inside vscode for example
cond = nil, ---@type boolean|fun(self:LazyPlugin):boolean|nil
-- version = "*", -- enable this to try installing the latest stable versions of plugins
},
-- leave nil when passing the spec as the first argument to setup()
spec = nil, ---@type LazySpec
lockfile = vim.fn.stdpath("config") .. "/lazy-lock.json", -- lockfile generated after running update.
concurrency = jit.os:find("Windows") and (vim.loop.available_parallelism() * 2) or nil, ---@type number limit the maximum amount of concurrent tasks
git = {
-- defaults for the `Lazy log` command
-- log = { "-10" }, -- show the last 10 commits
log = { "-8" }, -- show commits from the last 3 days
timeout = 120, -- kill processes that take more than 2 minutes
url_format = "https://github.com/%s.git",
-- lazy.nvim requires git >=2.19.0. If you really want to use lazy with an older version,
-- then set the below to false. This should work, but is NOT supported and will
-- increase downloads a lot.
filter = true,
},
dev = {
-- directory where you store your local plugin projects
path = "~/projects",
---@type string[] plugins that match these patterns will use your local versions instead of being fetched from GitHub
patterns = {}, -- For example {"folke"}
fallback = false, -- Fallback to git when local plugin doesn't exist
},
install = {
-- install missing plugins on startup. This doesn't increase startup time.
missing = true,
-- try to load one of these colorschemes when starting an installation during startup
colorscheme = { "habamax" },
},
ui = {
-- a number <1 is a percentage., >1 is a fixed size
size = { width = 0.8, height = 0.8 },
wrap = true, -- wrap the lines in the ui
-- The border to use for the UI window. Accepts same border values as |nvim_open_win()|.
border = "none",
title = nil, ---@type string only works when border is not "none"
title_pos = "center", ---@type "center" | "left" | "right"
-- Show pills on top of the Lazy window
pills = true, ---@type boolean
icons = {
cmd = "",
config = "",
event = "",
ft = "",
init = "",
import = "",
keys = "",
lazy = "󰒲 ",
loaded = "",
not_loaded = "",
plugin = "",
runtime = "",
source = "",
start = "",
task = "",
list = {
"",
"",
"",
"",
},
},
-- leave nil, to automatically select a browser depending on your OS.
-- If you want to use a specific browser, you can define it here
browser = nil, ---@type string?
throttle = 20, -- how frequently should the ui process render events
custom_keys = {
-- you can define custom key maps here.
-- To disable one of the defaults, set it to false
-- open lazygit log
["<localleader>l"] = function(plugin)
require("lazy.util").float_term({ "lazygit", "log" }, {
cwd = plugin.dir,
})
end,
-- open a terminal for the plugin dir
["<localleader>t"] = function(plugin)
require("lazy.util").float_term(nil, {
cwd = plugin.dir,
})
end,
},
},
diff = {
-- diff command <d> can be one of:
-- * browser: opens the github compare view. Note that this is always mapped to <K> as well,
-- so you can have a different command for diff <d>
-- * git: will run git diff and open a buffer with filetype git
-- * terminal_git: will open a pseudo terminal with git diff
-- * diffview.nvim: will open Diffview to show the diff
cmd = "git",
},
checker = {
-- automatically check for plugin updates
enabled = false,
concurrency = nil, ---@type number? set to 1 to check for updates very slowly
notify = true, -- get a notification when new updates are found
frequency = 3600, -- check for updates every hour
},
change_detection = {
-- automatically check for config file changes and reload the ui
enabled = true,
notify = true, -- get a notification when changes are found
},
performance = {
cache = {
enabled = true,
},
reset_packpath = true, -- reset the package path to improve startup time
rtp = {
reset = true, -- reset the runtime path to $VIMRUNTIME and your config directory
---@type string[]
paths = {}, -- add any custom paths here that you want to includes in the rtp
---@type string[] list any plugins you want to disable here
disabled_plugins = {
-- "gzip",
-- "matchit",
-- "matchparen",
-- "netrwPlugin",
-- "tarPlugin",
-- "tohtml",
-- "tutor",
-- "zipPlugin",
},
},
},
-- lazy can generate helptags from the headings in markdown readme files,
-- so :help works even for plugins that don't have vim docs.
-- when the readme opens with :help it will be correctly displayed as markdown
readme = {
enabled = true,
root = vim.fn.stdpath("state") .. "/lazy/readme",
files = { "README.md", "lua/**/README.md" },
-- only generate markdown helptags for plugins that dont have docs
skip_if_doc_exists = true,
},
state = vim.fn.stdpath("state") .. "/lazy/state.json", -- state info for checker and other things
build = {
-- Plugins can provide a `build.lua` file that will be executed when the plugin is installed
-- or updated. When the plugin spec also has a `build` command, the plugin's `build.lua` not be
-- executed. In this case, a warning message will be shown.
warn_on_override = true,
},
}
require("lazy").setup(plugins, opts)

View File

@ -1,137 +0,0 @@
local options = {
backup = false, -- creates a backup file
clipboard = "unnamedplus", -- allows neovim to access the system clipboard
cmdheight = 2, -- more space in the neovim command line for displaying messages
completeopt = { "menuone", "noselect" }, -- mostly just for cmp
conceallevel = 0, -- so that `` is visible in markdown files
fileencoding = "utf-8", -- the encoding written to a file
hlsearch = true, -- highlight all matches on previous search pattern
ignorecase = true, -- ignore case in search patterns
mouse = "a", -- allow the mouse to be used in neovim
pumheight = 10, -- pop up menu height
showmode = false, -- we don't need to see things like -- INSERT -- anymore
showtabline = 2, -- always show tabs
smartcase = true, -- smart case
smartindent = true, -- make indenting smarter again
splitbelow = true, -- force all horizontal splits to go below current window
splitright = true, -- force all vertical splits to go to the right of current window
swapfile = false, -- creates a swapfile
-- termguicolors = true, -- set term gui colors (most terminals support this)
timeoutlen = 1000, -- time to wait for a mapped sequence to complete (in milliseconds)
undofile = true, -- enable persistent undo
updatetime = 300, -- faster completion (4000ms default)
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
expandtab = true, -- convert tabs to spaces
shiftwidth = 4, -- the number of spaces inserted for each indentation
tabstop = 4, -- insert 4 spaces for a tab
cursorline = true, -- highlight the current line
number = true, -- set numbered lines
relativenumber = true, -- set relative numbered lines
numberwidth = 4, -- set number column width to 2 {default 4}
signcolumn = "yes", -- always show the sign column, otherwise it would shift the text each time
wrap = true, -- display lines as one long line
scrolloff = 8, -- is one of my fav
sidescrolloff = 8,
guifont = "monospace:h17", -- the font used in graphical neovim applications
}
vim.opt.shortmess:append "c"
for k, v in pairs(options) do
vim.opt[k] = v
end
vim.cmd "set whichwrap+=<,>,[,],h,l"
vim.cmd [[set iskeyword+=-]]
vim.cmd [[set formatoptions-=cro]] -- TODO: this doesn't seem to work
---- Hint: use `:h <option>` to figure out the meaning if needed
--vim.opt.clipboard = "unnamedplus" -- use system clipboard
--vim.opt.completeopt = {"menu", "menuone", "noselect"}
--vim.opt.mouse = "a" -- allow the mouse to be used in Nvim
--
---- Fonts
--vim.opt.encoding="utf-8"
--vim.opt.guifont = "Meslo LG M Bold for Powerline:h10"
--
---- Tab
--vim.opt.tabstop = 4 -- number of visual spaces per TAB
--vim.opt.softtabstop = 4 -- number of spacesin tab when editing
--vim.opt.shiftwidth = 4 -- insert 4 spaces on a tab
--vim.opt.expandtab = true -- tabs are spaces, mainly because of python
--
---- UI config
--vim.opt.number = true -- show absolute number
--vim.opt.relativenumber = true -- add numbers to each line on the left side
--vim.opt.cursorline = false -- highlight cursor line underneath the cursor horizontally
--vim.opt.splitbelow = true -- open new vertical split bottom
--vim.opt.splitright = true -- open new horizontal splits right
--vim.opt.termguicolors = true -- enable 23-bit RGB color in the TUI
--vim.opt.showmode = false -- we are experienced, wo don"t need the "-- INSERT --" mode hint
--
---- File recovery options
--vim.opt.swapfile = false
--vim.opt.backup = false
--vim.opt.undodir = os.getenv("HOME") .. "/.vim/undodir"
--vim.opt.undofile = true
--
---- Color column
--vim.opt.colorcolumn = "80"
--
---- Searching
--vim.opt.incsearch = true -- search as characters are entered
--vim.opt.hlsearch = false -- do not highlight matches
--vim.opt.ignorecase = true -- ignore case in searches by default
--vim.opt.smartcase = true -- but make it case sensitive if an uppercase is entered
--
---- LSP options
--vim.diagnostic.config({
-- virtual_text = false
--})
---- Show line diagnostics automatically in hover window
--vim.o.updatetime = 250
--vim.cmd [[autocmd CursorHold,CursorHoldI * lua vim.diagnostic.open_float(nil, {focus=false})]]
--
--
--
---- Leader key
--vim.g.mapleader = " "
----vim.g.maplocalleader = " "
--vim.g.maplocalleader = "\\"
--
---- Airline
--vim.g.airline_powerline_fonts = 1
--
---- Zig
--vim.g.zig_fmt_autosave = 1
---- Set completeopt to have a better completion experience
----set completeopt=menuone,noinsert,noselect
--vim.opt.completeopt = "menuone,noinsert,noselect"
---- Enable completions as you type
--vim.g.completion_enable_auto_popup = 1
--
---- Python
--vim.g.loaded_python_provider = 0
--vim.g.python3_host_prog = "/usr/local/bin/python"
--
---- Vimtex options:
--vim.g.vimtex_view_method = "zathura"
--vim.g.vimtex_general_viewer = "zathura"
--vim.g.vimtex_quickfix_mode = 0
--
---- Ignore mappings
--vim.g.vimtex_mappings_enabled = 1
--
------ Auto Indent
----vim.g["vimtex_indent_enabled"] = 1
--
------ Syntax highlighting
--vim.g.vimtex_syntax_enabled = 0
--
---- Error suppression:
--vim.g.vimtex_log_ignore = ({
-- "Underfull",
-- "Overfull",
-- "specifier changed to",
-- "Token not allowed in a PDF string",
--})

332
lua/eddie/lazy.lua Normal file
View File

@ -0,0 +1,332 @@
local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
if not vim.loop.fs_stat(lazypath) then
vim.fn.system({
"git",
"clone",
"--filter=blob:none",
"https://github.com/folke/lazy.nvim.git",
"--branch=stable", -- latest stable release
lazypath,
})
end
vim.opt.rtp:prepend(lazypath)
vim.g.mapleader = ' '
vim.g.maplocalleader = ' '
local plugins = {
{
'pwntester/octo.nvim',
dependencies = {
'nvim-lua/plenary.nvim',
'nvim-telescope/telescope.nvim',
'nvim-tree/nvim-web-devicons',
},
config = function()
require "octo".setup()
end
},
{
'nvim-telescope/telescope.nvim',
tag = '0.1.1',
dependencies = { { 'nvim-lua/plenary.nvim' } }
},
{
"windwp/nvim-ts-autotag",
dependencies = "nvim-treesitter/nvim-treesitter",
config = function()
require('nvim-ts-autotag').setup({})
end,
lazy = true,
event = "VeryLazy"
},
{
"nvim-treesitter/nvim-treesitter",
build = ":TSUpdate",
config = function()
local configs = require("nvim-treesitter.configs")
configs.setup({
ensure_installed = {
"bash",
"c",
"dockerfile",
"json",
"julia",
"latex",
"lua",
"vim",
"vimdoc",
"zig",
},
sync_install = false,
highlight = { enable = true },
indent = { enable = true },
})
end
},
{ 'nvim-telescope/telescope-fzf-native.nvim', build = 'make' },
{
"folke/tokyonight.nvim",
lazy = false, -- make sure we load this during startup if it is your main colorscheme
priority = 1000, -- make sure to load this before all the other start plugins
config = function()
-- load the colorscheme here
vim.cmd('colorscheme tokyonight-night')
end,
},
'nvim-treesitter/playground',
'ThePrimeagen/harpoon',
{
'mbbill/undotree',
config = function()
vim.keymap.set("n", "<leader>u", "<cmd>Telescope undo<CR>", { desc = "Telescope Undo"})
end
},
{
'tpope/vim-fugitive',
config = function()
vim.keymap.set("n", "<leader>gs", vim.cmd.Git, { desc = "Open Fugitive Panel"})
end
},
'tpope/vim-repeat',
{
'numToStr/Comment.nvim',
config = function()
require('Comment').setup()
end
},
{
"windwp/nvim-autopairs",
config = function()
require("nvim-autopairs").setup()
end
},
{
"nvim-neotest/neotest",
dependencies = {
"nvim-lua/plenary.nvim",
"nvim-treesitter/nvim-treesitter",
"antoinemadec/FixCursorHold.nvim",
"olimorris/neotest-rspec",
"haydenmeade/neotest-jest",
"zidhuss/neotest-minitest",
"mfussenegger/nvim-dap",
"jfpedroza/neotest-elixir",
},
opts = {
adapters = {
["neotest-elixir"] = {},
["neotest-minitest"] = {},
},
},
config = function()
local neotest = require('neotest')
local neotest_jest = require('neotest-jest')({
jestCommand = 'npm test --'
})
neotest_jest.filter_dir = function(name)
return name ~= 'node_modules' and name ~= '__snapshots__'
end
neotest.setup({
adapters = {
require('neotest-rspec')({
rspec_cmd = function()
return vim.tbl_flatten({
"bundle",
"exec",
"rspec",
})
end
}),
neotest_jest,
},
output_panel = {
enabled = true,
open = "botright split | resize 15"
},
quickfix = {
open = false,
}
})
end
},
{
"mfussenegger/nvim-dap",
dependencies = {
{
"rcarriga/nvim-dap-ui",
config = function(_, opts)
local dap = require("dap")
local dapui = require("dapui")
dapui.setup(opts)
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
end,
},
{
"suketa/nvim-dap-ruby",
config = function()
require("dap-ruby").setup()
end,
},
{
"theHamsta/nvim-dap-virtual-text",
opts = {},
},
{
"jay-babu/mason-nvim-dap.nvim",
dependencies = "mason.nvim",
cmd = { "DapInstall", "DapUninstall" },
opts = {
automatic_installation = true,
handlers = {},
ensure_installed = {},
},
},
{ "jbyuki/one-small-step-for-vimkind", module = "osv" },
},
},
{
"mxsdev/nvim-dap-vscode-js",
dependencies = { "mfussenegger/nvim-dap" }
},
{
'nvim-lualine/lualine.nvim',
dependencies = { 'nvim-tree/nvim-web-devicons' },
config = function()
require('lualine').setup({
options = {
theme = 'palenight'
}
})
end
},
{
"kylechui/nvim-surround",
version = "*", -- Use for stability; omit to use `main` branch for the latest features
event = "VeryLazy",
config = function()
require("nvim-surround").setup({
})
end
},
{
'junegunn/fzf',
build = ":call fzf#install()"
},
'nanotee/zoxide.vim',
'nvim-telescope/telescope-ui-select.nvim',
'debugloop/telescope-undo.nvim',
{
"AckslD/nvim-neoclip.lua",
dependencies = {
{ 'nvim-telescope/telescope.nvim' },
},
},
'jinh0/eyeliner.nvim',
{
"anuvyklack/windows.nvim",
dependencies = {
"anuvyklack/middleclass",
"anuvyklack/animation.nvim"
},
config = function()
vim.o.winwidth = 10
vim.o.winminwidth = 10
vim.o.equalalways = false
require('windows').setup()
end
},
{
'voldikss/vim-floaterm',
config = function()
vim.keymap.set("n", "<leader>ft",
"<cmd>:FloatermNew --height=0.7 --width=0.8 --wintype=float --name=floaterm1 --position=center --autoclose=2<CR>", { desc = "Open FloatTerm"})
vim.keymap.set("n", "<leader>flt",
"<cmd>:FloatermToggle<CR>", { desc = "Toggle FloatTerm"})
vim.keymap.set("t", "<leader>flt",
"<cmd>:FloatermToggle<CR>", { desc = "Toggle FloatTerm"})
end
},
{
'tummetott/unimpaired.nvim',
config = function()
require('unimpaired').setup()
end
},
'airblade/vim-gitgutter',
'mg979/vim-visual-multi',
'tpope/vim-rails',
{
'kevinhwang91/nvim-ufo',
dependencies = 'kevinhwang91/promise-async'
},
{
'VonHeikemen/lsp-zero.nvim',
branch = 'v2.x',
dependencies = {
-- LSP Support
{ 'neovim/nvim-lspconfig' }, -- Required
{ -- Optional
'williamboman/mason.nvim',
build = function()
pcall(vim.cmd, 'MasonUpdate')
end,
},
{ 'williamboman/mason-lspconfig.nvim' }, -- Optional
-- Autocompletion
{ 'hrsh7th/nvim-cmp' }, -- Required
{ 'hrsh7th/cmp-nvim-lsp' }, -- Required
{ 'L3MON4D3/LuaSnip' }, -- Required
{ "rafamadriz/friendly-snippets" },
{ 'hrsh7th/cmp-buffer' },
{ 'hrsh7th/cmp-path' },
{ 'hrsh7th/cmp-cmdline' },
{ 'saadparwaiz1/cmp_luasnip' },
}
},
{
'jose-elias-alvarez/null-ls.nvim',
config = function()
require('null-ls').setup({
})
end,
dependencies = { 'nvim-lua/plenary.nvim' },
},
{
'folke/which-key.nvim',
event = "VeryLazy",
init = function()
vim.o.timeout = true
vim.o.timeoutlen = 500
end,
opts = {}
},
{ "nvim-telescope/telescope-live-grep-args.nvim" },
{
"aaronhallaert/advanced-git-search.nvim",
dependencies = {
"nvim-telescope/telescope.nvim",
"tpope/vim-fugitive",
'tpope/vim-rhubarb',
},
},
}
require('lazy').setup(plugins, {
change_detection = {
notify = false,
}
})

43
lua/eddie/options.lua Normal file
View File

@ -0,0 +1,43 @@
vim.g.mapleader = ' '
vim.g.maplocalleader = ' '
vim.opt.guicursor = ""
vim.opt.nu = true
vim.opt.relativenumber = true
vim.opt.tabstop = 4
vim.opt.softtabstop = 4
vim.opt.shiftwidth = 4
vim.opt.expandtab = true
vim.opt.smartindent = true
vim.opt.wrap = false
vim.opt.swapfile = false
vim.opt.backup = false
vim.opt.undodir = os.getenv("HOME") .. "/.vim/undodir"
vim.opt.undofile = true
vim.opt.hlsearch = false
vim.opt.incsearch = true
vim.opt.termguicolors = true
vim.opt.scrolloff = 8
vim.opt.signcolumn = "yes"
vim.opt.isfname:append("@-@")
vim.opt.updatetime = 50
vim.opt.colorcolumn = "80"
-- LSP options
vim.diagnostic.config({
virtual_text = false
})
-- Show line diagnostics automatically in hover window
vim.o.updatetime = 250
vim.cmd [[autocmd CursorHold,CursorHoldI * lua vim.diagnostic.open_float(nil, {focus=false})]]

110
lua/eddie/remaps.lua Normal file
View File

@ -0,0 +1,110 @@
-- Open Ex as buffer
vim.keymap.set("n", "<leader>pv", vim.cmd.Ex, { desc = "Open Ex"})
-- Exit insert mode without hitting Esc
vim.keymap.set("i", "jj", "<Esc>", { desc = "Esc"})
-- Make Y behave like C or D
vim.keymap.set("n", "Y", "y$")
-- Keep window centered when going up/down
vim.keymap.set("n", "J", "mzJ`z")
vim.keymap.set("n", "<C-d>", "<C-d>zz")
vim.keymap.set("n", "<C-u>", "<C-u>zz")
vim.keymap.set("n", "n", "nzzzv")
vim.keymap.set("n", "N", "Nzzzv")
-- Paste without overwriting register
vim.keymap.set("v", "p", '"_dP')
-- Copy text to " register
vim.keymap.set("n", "<leader>y", "\"+y", { desc = "Yank into \" register"})
vim.keymap.set("v", "<leader>y", "\"+y", { desc = "Yank into \" register"})
vim.keymap.set("n", "<leader>Y", "\"+Y", { desc = "Yank into \" register"})
-- Delete text to " register
vim.keymap.set("n", "<leader>d", "\"_d", { desc = "Delete into \" register"})
vim.keymap.set("v", "<leader>d", "\"_d", { desc = "Delete into \" register"})
-- Get out Q
vim.keymap.set("n", "Q", "<nop>")
-- close buffer
vim.keymap.set("n", "<leader>q", "<cmd>bd<CR>", { desc = "Close Buffer"})
-- Close buffer without closing split
vim.keymap.set("n", "<leader>w", "<cmd>bp|bd #<CR>", { desc = "Close Buffer; Retain Split"})
-- Navigate between quickfix items
vim.keymap.set("n", "<leader>h", "<cmd>cnext<CR>zz", { desc = "Forward qfixlist"})
vim.keymap.set("n", "<leader>;", "<cmd>cprev<CR>zz", { desc = "Backward qfixlist"})
-- Navigate between location list items
vim.keymap.set("n", "<leader>k", "<cmd>lnext<CR>zz", { desc = "Forward location list"})
vim.keymap.set("n", "<leader>j", "<cmd>lprev<CR>zz", { desc = "Backward location list"})
-- Replace word under cursor across entire buffer
vim.keymap.set("n", "<leader>s", [[:%s/\<<C-r><C-w>\>/<C-r><C-w>/gI<Left><Left><Left>]], { desc = "Replace word under cursor"})
-- Make current file executable
vim.keymap.set("n", "<leader>x", "<cmd>!chmod +x %<CR>", { silent = true, desc = "Make current file executable" })
-- Jump to plugin management file
vim.keymap.set("n", "<leader>vpp", "<cmd>e ~/.config/nvim/lua/exosyphon/lazy.lua<CR>", { desc = "Jump to lazy.lua"})
-- Run Tests
vim.keymap.set("n", "<leader>t", "<cmd>lua require('neotest').run.run()<CR>", { desc = "Run Test"})
vim.keymap.set("n", "<leader>tf", "<cmd>lua require('neotest').run.run(vim.fn.expand('%'))<CR>", { desc = "Run Test File"} )
vim.keymap.set("n", "<leader>td", "<cmd>lua require('neotest').run.run(vim.fn.getcwd())<CR>", { desc = "Run Current Test Directory"})
vim.keymap.set("n", "<leader>tp", "<cmd>lua require('neotest').output_panel.toggle()<CR>", { desc = "Toggle Test Output Panel"})
vim.keymap.set("n", "<leader>tl", "<cmd>lua require('neotest').run.run_last()<CR>", { desc = "Run Last Test"})
vim.keymap.set("n", "<leader>ts", "<cmd>lua require('neotest').summary.toggle()<CR>", { desc = "Toggle Test Summary"})
-- Debug Tests
vim.keymap.set("n", "<leader>dt", "<cmd>DapContinue<CR>", { desc = "Start Debugging"})
vim.keymap.set("n", "<leader>dc", "<cmd>DapContinue<CR>", { desc = "Start Debugging"})
vim.keymap.set("n", "<leader>dso", "<cmd>DapStepOver<CR>", { desc = "Step Over"})
vim.keymap.set("n", "<leader>dsi", "<cmd>DapStepInto<CR>", { desc = "Step Into"})
vim.keymap.set("n", "<leader>dsu", "<cmd>DapStepOut<CR>", { desc = "Step Out"})
vim.keymap.set("n", "<leader>dst", "<cmd>DapStepTerminate<CR>", { desc = "Stop Debugger"})
vim.keymap.set("n", "<leader>b", "<cmd>lua require'dap'.toggle_breakpoint()<CR>", { desc = "Toggle Breakpoint"})
vim.keymap.set("n", "<leader>B", "<cmd>lua require'dap'.set_breakpoint(vim.fn.input('Breakpoint condition: '))<CR>", { desc = "Toggle Breakpoint Condition"})
vim.keymap.set("n", "<leader>E", "<cmd>lua require'dap'.set_exception_breakpoints()<CR>", { desc = "Toggle Exception Breakpoint"})
vim.keymap.set("n", "<leader>dr", "<cmd>lua require'dapui'.float_element('repl', { width = 100, height = 40, enter = true })<CR>", { desc = "Show DAP REPL"})
vim.keymap.set("n", "<leader>ds", "<cmd>lua require'dapui'.float_element('scopes', { width = 150, height = 50, enter = true })<CR>", { desc = "Show DAP Scopes"})
vim.keymap.set("n", "<leader>df", "<cmd>lua require'dapui'.float_element('stacks', { width = 150, height = 50, enter = true })<CR>", { desc = "Show DAP Stacks"})
vim.keymap.set("n", "<leader>db", "<cmd>lua require'dapui'.float_element('breakpoints', { enter = true })<CR>", { desc = "Show DAP breakpoints"})
vim.keymap.set("n", "<leader>do", "<cmd>lua require'dapui'.toggle()<CR>", { desc = "Toggle DAP UI"})
vim.keymap.set("n", "<leader>dl", "<cmd>lua require'dap'.run_last()<CR>", { desc = "Debug Last Test"})
-- Git revert at current cursor location
vim.keymap.set("n", "<leader>U", "<cmd>GitGutterUndoHunk<CR>", { desc = "Revert Git Hunk"})
-- Copy file paths
vim.keymap.set("n", "<leader>cf", "<cmd>let @+ = expand(\"%\")<CR>", { desc = "Copy File Name"})
vim.keymap.set("n", "<leader>cp", "<cmd>let @+ = expand(\"%:p\")<CR>", { desc = "Copy File Path"})
vim.keymap.set("n", "<leader><leader>", function()
vim.cmd("so")
end, { desc = "Source current file"})
-- Open Zoxide telescope extension
vim.keymap.set("n", "<leader>Z", "<cmd>Zi<CR>", { desc = "Open Zoxide"})
-- Resize with arrows
vim.keymap.set("n", "<C-S-Down>", ":resize +2<CR>", { desc = "Resize Horizontal Split Down"})
vim.keymap.set("n", "<C-S-Up>", ":resize -2<CR>", { desc = "Resize Horizontal Split Up"})
vim.keymap.set("n", "<C-Left>", ":vertical resize -2<CR>", { desc = "Resize Vertical Split Down"})
vim.keymap.set("n", "<C-Right>", ":vertical resize +2<CR>", { desc = "Resize Vertical Split Up"})
-- Visual --
-- Stay in indent mode
vim.keymap.set("v", "<", "<gv")
vim.keymap.set("v", ">", ">gv")
-- Move block
vim.keymap.set("v", "J", ":m '>+1<CR>gv=gv", { desc = "Move Block Down"})
vim.keymap.set("v", "K", ":m '<-2<CR>gv=gv", { desc = "Move Block Up"})
-- Search for highlighted text in buffer
vim.keymap.set("v", "//", 'y/<C-R>"<CR>', { desc = "Search for highlighted text"})

View File

@ -1,11 +0,0 @@
return {
{
"folke/tokyonight.nvim",
lazy = false, -- make sure we load this during startup if it is your main colorscheme
priority = 1000, -- make sure to load this before all the other start plugins
config = function()
-- load the colorscheme here
require("config.colorscheme")
end,
},
}

View File

@ -1,6 +0,0 @@
-- plugins/telescope.lua:
return {
'nvim-telescope/telescope.nvim', tag = '0.1.2',
-- or , branch = '0.1.x',
dependencies = { 'nvim-lua/plenary.nvim' }
}