mirror of
https://github.com/tedkulp/dotfiles
synced 2026-03-05 13:40:18 -05:00
feat: redid lunarvim config
This commit is contained in:
@@ -10,19 +10,28 @@ an executable
|
||||
|
||||
-- general
|
||||
lvim.log.level = "warn"
|
||||
lvim.format_on_save = true
|
||||
lvim.colorscheme = "onedarker"
|
||||
-- lvim.format_on_save = true
|
||||
lvim.colorscheme = "dracula"
|
||||
-- to disable icons and use a minimalist setup, uncomment the following
|
||||
-- lvim.use_icons = false
|
||||
vim.opt.clipboard = "unnamed,unnamedplus"
|
||||
-- vim.opt.list = true
|
||||
-- vim.opt.listchars:append("eol:↴")
|
||||
|
||||
-- keymappings [view all the defaults by pressing <leader>Lk]
|
||||
lvim.leader = "space"
|
||||
-- add your own keymapping
|
||||
lvim.keys.normal_mode["<C-s>"] = ":w<cr>"
|
||||
lvim.format_on_save = {
|
||||
timeout = 5000,
|
||||
}
|
||||
lvim.builtin.lualine.style = "default"
|
||||
|
||||
-- unmap a default keymapping
|
||||
-- vim.keymap.del("n", "<C-Up>")
|
||||
-- override a default keymapping
|
||||
-- lvim.keys.normal_mode["<C-q>"] = ":q<cr>" -- or vim.keymap.set("n", "<C-q>", ":q<cr>" )
|
||||
vim.keymap.set("n", "<f1>", "<nop>")
|
||||
|
||||
-- Change Telescope navigation to use j and k for navigation and n and p for history in both input and normal mode.
|
||||
-- we use protected-mode (pcall) just in case the plugin wasn't loaded yet.
|
||||
@@ -42,39 +51,17 @@ lvim.builtin.telescope.defaults.mappings = {
|
||||
},
|
||||
}
|
||||
|
||||
lvim.builtin.telescope.on_config_done = function(telescope)
|
||||
telescope.setup{
|
||||
extensions = {
|
||||
project = {
|
||||
base_dirs = {
|
||||
-- {path = '~/src', max_depth = 1},
|
||||
-- {path = '~/src/tmp', max_depth = 1},
|
||||
-- {path = '~/src/omuras/code', max_depth = 1},
|
||||
{path = '~/src'},
|
||||
{path = '~/src/tmp'},
|
||||
{path = '~/src/omuras/code'},
|
||||
{path = '~/org'},
|
||||
},
|
||||
hidden_files = true,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
pcall(telescope.load_extension, "file-browser")
|
||||
pcall(telescope.load_extension, "project")
|
||||
end
|
||||
|
||||
-- Use which-key to add extra bindings with the leader-key prefix
|
||||
lvim.builtin.which_key.mappings["P"] = { "<cmd>Telescope projects<CR>", "Projects" }
|
||||
-- lvim.builtin.which_key.mappings["t"] = {
|
||||
-- name = "+Trouble",
|
||||
-- r = { "<cmd>Trouble lsp_references<cr>", "References" },
|
||||
-- f = { "<cmd>Trouble lsp_definitions<cr>", "Definitions" },
|
||||
-- d = { "<cmd>Trouble document_diagnostics<cr>", "Diagnostics" },
|
||||
-- q = { "<cmd>Trouble quickfix<cr>", "QuickFix" },
|
||||
-- l = { "<cmd>Trouble loclist<cr>", "LocationList" },
|
||||
-- w = { "<cmd>Trouble workspace_diagnostics<cr>", "Wordspace Diagnostics" },
|
||||
-- }
|
||||
-- lvim.builtin.which_key.mappings["P"] = { "<cmd>Telescope projects<CR>", "Projects" }
|
||||
lvim.builtin.which_key.mappings["t"] = {
|
||||
name = "+Trouble",
|
||||
r = { "<cmd>Trouble lsp_references<cr>", "References" },
|
||||
f = { "<cmd>Trouble lsp_definitions<cr>", "Definitions" },
|
||||
d = { "<cmd>Trouble document_diagnostics<cr>", "Diagnostics" },
|
||||
q = { "<cmd>Trouble quickfix<cr>", "QuickFix" },
|
||||
l = { "<cmd>Trouble loclist<cr>", "LocationList" },
|
||||
w = { "<cmd>Trouble workspace_diagnostics<cr>", "Wordspace Diagnostics" },
|
||||
}
|
||||
|
||||
-- TODO: User Config for predefined plugins
|
||||
-- After changing plugin config exit and reopen LunarVim, Run :PackerInstall :PackerCompile
|
||||
@@ -83,7 +70,7 @@ lvim.builtin.alpha.mode = "dashboard"
|
||||
lvim.builtin.notify.active = true
|
||||
lvim.builtin.terminal.active = true
|
||||
lvim.builtin.nvimtree.setup.view.side = "left"
|
||||
lvim.builtin.nvimtree.show_icons.git = 0
|
||||
lvim.builtin.nvimtree.setup.renderer.icons.show.git = false
|
||||
|
||||
-- if you don't want all the parsers change this to a table of the ones you want
|
||||
lvim.builtin.treesitter.ensure_installed = {
|
||||
@@ -103,9 +90,6 @@ lvim.builtin.treesitter.ensure_installed = {
|
||||
|
||||
lvim.builtin.treesitter.ignore_install = { "haskell" }
|
||||
lvim.builtin.treesitter.highlight.enabled = true
|
||||
lvim.builtin.project.active = false
|
||||
|
||||
lvim.lsp.null_ls.setup.timeout_ms = 30000
|
||||
|
||||
-- generic LSP settings
|
||||
|
||||
@@ -189,135 +173,81 @@ lvim.lsp.null_ls.setup.timeout_ms = 30000
|
||||
-- -- let treesitter use bash highlight for zsh files as well
|
||||
-- require("nvim-treesitter.highlight").attach(0, "bash")
|
||||
-- end,
|
||||
-- })
|
||||
|
||||
lvim.plugins = {
|
||||
{
|
||||
"dracula/vim",
|
||||
},
|
||||
{
|
||||
"tpope/vim-surround",
|
||||
keys = { "c", "d", "y" },
|
||||
},
|
||||
{
|
||||
"ethanholz/nvim-lastplace",
|
||||
event = "BufRead",
|
||||
config = function()
|
||||
require("nvim-lastplace").setup({
|
||||
lastplace_ignore_buftype = { "quickfix", "nofile", "help" },
|
||||
lastplace_ignore_filetype = {
|
||||
"gitcommit",
|
||||
"gitrebase",
|
||||
"svn",
|
||||
"hgcommit",
|
||||
},
|
||||
lastplace_open_folds = true,
|
||||
})
|
||||
end,
|
||||
},
|
||||
{
|
||||
"lukas-reineke/indent-blankline.nvim",
|
||||
event = "BufRead",
|
||||
setup = function()
|
||||
vim.g.indentLine_enabled = 1
|
||||
vim.g.indent_blankline_char = "▏"
|
||||
vim.g.indent_blankline_filetype_exclude = { "help", "terminal", "dashboard" }
|
||||
vim.g.indent_blankline_buftype_exclude = { "terminal" }
|
||||
vim.g.indent_blankline_show_trailing_blankline_indent = false
|
||||
vim.g.indent_blankline_show_first_indent_level = false
|
||||
end,
|
||||
},
|
||||
{
|
||||
"ggandor/lightspeed.nvim",
|
||||
event = "BufRead",
|
||||
config = function()
|
||||
require('lightspeed').setup {
|
||||
exit_after_idle_msecs = {
|
||||
labeled = 3000,
|
||||
unlabeled = 3000,
|
||||
},
|
||||
limit_ft_matches = 5,
|
||||
}
|
||||
end
|
||||
},
|
||||
{
|
||||
"nacro90/numb.nvim",
|
||||
event = "BufRead",
|
||||
config = function()
|
||||
require("numb").setup({
|
||||
show_numbers = true, -- Enable 'number' for the window while peeking
|
||||
show_cursorline = true, -- Enable 'cursorline' for the window while peeking
|
||||
})
|
||||
end,
|
||||
},
|
||||
{
|
||||
"windwp/nvim-spectre",
|
||||
event = "BufRead",
|
||||
config = function()
|
||||
require("spectre").setup()
|
||||
end,
|
||||
},
|
||||
{
|
||||
"andymass/vim-matchup",
|
||||
event = "CursorMoved",
|
||||
config = function()
|
||||
vim.g.matchup_matchparen_offscreen = { method = "popup" }
|
||||
end,
|
||||
},
|
||||
{
|
||||
"p00f/nvim-ts-rainbow",
|
||||
},
|
||||
{ "tpope/vim-repeat" },
|
||||
-- {
|
||||
-- "monaqa/dial.nvim",
|
||||
-- event = "BufRead",
|
||||
-- config = function()
|
||||
-- local dial = require("dial")
|
||||
-- vim.cmd([[
|
||||
-- nmap <C-a> <Plug>(dial-increment)
|
||||
-- nmap <C-x> <Plug>(dial-decrement)
|
||||
-- vmap <C-a> <Plug>(dial-increment)
|
||||
-- vmap <C-x> <Plug>(dial-decrement)
|
||||
-- vmap g<C-a> <Plug>(dial-increment-additional)
|
||||
-- vmap g<C-x> <Plug>(dial-decrement-additional)
|
||||
-- ]])
|
||||
|
||||
-- dial.augends["custom#boolean"] = dial.common.enum_cyclic({
|
||||
-- name = "boolean",
|
||||
-- strlist = { "true", "false" },
|
||||
-- })
|
||||
-- table.insert(dial.config.searchlist.normal, "custom#boolean")
|
||||
|
||||
-- -- For Languages which prefer True/False, e.g. python.
|
||||
-- dial.augends["custom#Boolean"] = dial.common.enum_cyclic({
|
||||
-- name = "Boolean",
|
||||
-- strlist = { "True", "False" },
|
||||
-- })
|
||||
-- table.insert(dial.config.searchlist.normal, "custom#Boolean")
|
||||
-- end,
|
||||
-- },
|
||||
-- {
|
||||
-- "mrjones2014/dash.nvim",
|
||||
-- run = "make install",
|
||||
-- },
|
||||
{
|
||||
"nvim-orgmode/orgmode",
|
||||
"tpope/vim-surround",
|
||||
keys = { "c", "d", "y" },
|
||||
},
|
||||
{
|
||||
"andymass/vim-matchup",
|
||||
event = "CursorMoved",
|
||||
config = function()
|
||||
require('orgmode').setup{
|
||||
org_blank_before_new_entry = {
|
||||
heading = false,
|
||||
plain_list_item = false,
|
||||
}
|
||||
}
|
||||
vim.g.matchup_matchparen_offscreen = { method = "popup" }
|
||||
end,
|
||||
},
|
||||
-- {
|
||||
-- "dhruvasagar/vim-table-mode",
|
||||
-- },
|
||||
{
|
||||
"akinsho/org-bullets.nvim",
|
||||
setup = function()
|
||||
symbols = { "◉", "○", "✸", "✿" }
|
||||
end
|
||||
"p00f/nvim-ts-rainbow",
|
||||
event = "BufRead",
|
||||
config = function()
|
||||
require("nvim-treesitter.configs").setup({
|
||||
rainbow = {
|
||||
enable = true,
|
||||
},
|
||||
})
|
||||
end,
|
||||
},
|
||||
{
|
||||
"tpope/vim-repeat"
|
||||
},
|
||||
{
|
||||
"ethanholz/nvim-lastplace",
|
||||
event = "BufRead",
|
||||
config = function()
|
||||
require("nvim-lastplace").setup({
|
||||
lastplace_ignore_buftype = { "quickfix", "nofile", "help" },
|
||||
lastplace_ignore_filetype = {
|
||||
"gitcommit",
|
||||
"gitrebase",
|
||||
"svn",
|
||||
"hgcommit",
|
||||
},
|
||||
lastplace_open_folds = true,
|
||||
})
|
||||
end,
|
||||
},
|
||||
{
|
||||
"lukas-reineke/indent-blankline.nvim",
|
||||
event = "BufRead",
|
||||
config = function()
|
||||
require("indent_blankline").setup({
|
||||
filetype_exclude = { "help", "terminal", "dashboard", "lspinfo" },
|
||||
buftype_exclude = { "terminal", "dashboard", "nofile", "quickfix" },
|
||||
show_trailing_blankline_indent = false,
|
||||
show_first_indent_level = false,
|
||||
show_current_context = true,
|
||||
show_current_context_start = true,
|
||||
})
|
||||
end,
|
||||
},
|
||||
{
|
||||
"ggandor/leap.nvim",
|
||||
event = "BufRead",
|
||||
config = function()
|
||||
require("leap").set_default_keymaps()
|
||||
end,
|
||||
},
|
||||
{
|
||||
"windwp/nvim-spectre",
|
||||
event = "BufRead",
|
||||
config = function()
|
||||
require("spectre").setup()
|
||||
lvim.builtin.which_key.mappings["S"] = { "<cmd>lua require('spectre').open()<CR>", "Spectre Search" }
|
||||
end,
|
||||
},
|
||||
{
|
||||
"nvim-telescope/telescope-project.nvim",
|
||||
@@ -333,111 +263,121 @@ lvim.plugins = {
|
||||
"ray-x/lsp_signature.nvim",
|
||||
event = "BufRead",
|
||||
config = function()
|
||||
require "lsp_signature".setup()
|
||||
end
|
||||
require("lsp_signature").setup({})
|
||||
end,
|
||||
},
|
||||
{
|
||||
"folke/trouble.nvim",
|
||||
cmd = "TroubleToggle",
|
||||
},
|
||||
{
|
||||
"rmagatti/goto-preview",
|
||||
'rmagatti/goto-preview',
|
||||
config = function()
|
||||
require('goto-preview').setup {
|
||||
width = 120; -- Width of the floating window
|
||||
height = 25; -- Height of the floating window
|
||||
default_mappings = true; -- Bind default mappings
|
||||
debug = false; -- Print debug information
|
||||
opacity = nil; -- 0-100 opacity level of the floating window where 100 is fully transparent.
|
||||
post_open_hook = nil;-- A function taking two arguments, a buffer and a window to be ran as a hook.
|
||||
-- You can use "default_mappings = true" setup option
|
||||
-- Or explicitly set keybindings
|
||||
vim.cmd("nnoremap gPd <cmd>lua require('goto-preview').goto_preview_definition()<CR>");
|
||||
vim.cmd("nnoremap gPi <cmd>lua require('goto-preview').goto_preview_implementation()<CR>");
|
||||
vim.cmd("nnoremap gPc <cmd>lua require('goto-preview').close_all_win()<CR>");
|
||||
require('goto-preview').setup({
|
||||
default_mappings = true;
|
||||
})
|
||||
end
|
||||
},
|
||||
{
|
||||
"editorconfig/editorconfig-vim"
|
||||
},
|
||||
{
|
||||
"monaqa/dial.nvim",
|
||||
event = "BufRead",
|
||||
config = function()
|
||||
local augend = require("dial.augend")
|
||||
vim.cmd [[
|
||||
nmap <C-w> <Plug>(dial-increment)
|
||||
nmap <C-x> <Plug>(dial-decrement)
|
||||
vmap <C-w> <Plug>(dial-increment)
|
||||
vmap <C-x> <Plug>(dial-decrement)
|
||||
vmap g<C-w> <Plug>(dial-increment-additional)
|
||||
vmap g<C-x> <Plug>(dial-decrement-additional)
|
||||
]]
|
||||
|
||||
require("dial.config").augends:register_group {
|
||||
default = {
|
||||
augend.integer.alias.decimal,
|
||||
augend.integer.alias.hex,
|
||||
augend.date.alias["%Y/%m/%d"],
|
||||
augend.date.alias["%Y-%m-%d"],
|
||||
augend.date.alias["%m/%d"],
|
||||
augend.date.alias["%H:%M"],
|
||||
augend.constant.alias.bool,
|
||||
augend.constant.new { elements = { "True", "False" } }, -- Python
|
||||
augend.hexcolor.new {
|
||||
case = "lower",
|
||||
},
|
||||
},
|
||||
}
|
||||
end,
|
||||
},
|
||||
}
|
||||
|
||||
|
||||
|
||||
lvim.builtin.which_key.mappings["t"] = {
|
||||
name = "Diagnostics",
|
||||
t = { "<cmd>TroubleToggle<cr>", "trouble" },
|
||||
w = { "<cmd>TroubleToggle workspace_diagnostics<cr>", "workspace" },
|
||||
d = { "<cmd>TroubleToggle document_diagnostics<cr>", "document" },
|
||||
q = { "<cmd>TroubleToggle quickfix<cr>", "quickfix" },
|
||||
l = { "<cmd>TroubleToggle loclist<cr>", "loclist" },
|
||||
r = { "<cmd>TroubleToggle lsp_references<cr>", "references" },
|
||||
}
|
||||
|
||||
-- org mode
|
||||
local parser_config = require "nvim-treesitter.parsers".get_parser_configs()
|
||||
parser_config.org = {
|
||||
install_info = {
|
||||
url = 'https://github.com/milisims/tree-sitter-org',
|
||||
revision = 'f110024d539e676f25b72b7c80b0fd43c34264ef',
|
||||
files = {'src/parser.c', 'src/scanner.cc'},
|
||||
},
|
||||
filetype = 'org',
|
||||
}
|
||||
|
||||
require('orgmode').setup_ts_grammar()
|
||||
|
||||
require'nvim-treesitter.configs'.setup {
|
||||
-- If TS highlights are not enabled at all, or disabled via `disable` prop, highlighting will fallback to default Vim syntax highlighting
|
||||
highlight = {
|
||||
enable = true,
|
||||
disable = {'org'}, -- Remove this to use TS highlighter for some of the highlights (Experimental)
|
||||
additional_vim_regex_highlighting = {'org'}, -- Required since TS highlighter doesn't support all syntax features (conceal)
|
||||
},
|
||||
ensure_installed = {'org'}, -- Or run :TSUpdate org
|
||||
}
|
||||
|
||||
require('orgmode').setup({
|
||||
org_agenda_files = {'~/org/**/*'},
|
||||
org_default_notes_file = '~/org/refile.org',
|
||||
})
|
||||
|
||||
-- javascript/typescript
|
||||
-- set additional formatters
|
||||
local formatters = require "lvim.lsp.null-ls.formatters"
|
||||
formatters.setup {
|
||||
{
|
||||
exe = "prettier",
|
||||
command = "prettierd",
|
||||
filetypes = { "typescript", "typescriptreact", "javascript", "javascriptreact", "json" },
|
||||
},
|
||||
{
|
||||
exe = "eslint",
|
||||
command = "eslint_d",
|
||||
filetypes = { "typescript", "typescriptreact", "javascript", "javascriptreact" },
|
||||
},
|
||||
{
|
||||
exe = "rustfmt",
|
||||
command = "rustfmt",
|
||||
filetypes = { "rust" },
|
||||
},
|
||||
{
|
||||
exe = "gofmt",
|
||||
command = "gofmt",
|
||||
filetypes = { "go" },
|
||||
},
|
||||
}
|
||||
|
||||
-- set additional linters
|
||||
local linters = require "lvim.lsp.null-ls.linters"
|
||||
linters.setup {
|
||||
{
|
||||
exe = "eslint",
|
||||
command = "eslint_d",
|
||||
filetypes = { "typescript", "typescriptreact", "javascript", "javascriptreact" },
|
||||
},
|
||||
}
|
||||
|
||||
lvim.builtin.which_key.mappings["P"] = { "<cmd>lua require'telescope'.extensions.project.project{ display_type = 'full' }<CR>", "Projects" }
|
||||
lvim.builtin.telescope.on_config_done = function(telescope)
|
||||
telescope.setup {
|
||||
pickers = {
|
||||
buffers = {
|
||||
mappings = {
|
||||
n = {
|
||||
["D"] = "delete_buffer"
|
||||
},
|
||||
i = {
|
||||
["<c-d>"] = "delete_buffer"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
extensions = {
|
||||
project = {
|
||||
base_dirs = {
|
||||
-- {path = '~/src', max_depth = 1},
|
||||
-- {path = '~/src/tmp', max_depth = 1},
|
||||
-- {path = '~/src/omuras/code', max_depth = 1},
|
||||
{ path = '~/src' },
|
||||
{ path = '~/src/tmp' },
|
||||
{ path = '~/src/omuras/code' },
|
||||
{ path = '~/org' },
|
||||
},
|
||||
hidden_files = true,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
pcall(telescope.load_extension, "file-browser")
|
||||
pcall(telescope.load_extension, "project")
|
||||
end
|
||||
|
||||
lvim.builtin.which_key.mappings["P"] = { "<cmd>lua require'telescope'.extensions.project.project{ display_type = 'full' }<CR>",
|
||||
"Projects" }
|
||||
lvim.builtin.which_key.mappings['`'] = { ":edit #<CR>", "Last Buffer" }
|
||||
lvim.builtin.which_key.mappings['lP'] = { "<cmd>lua require('goto-preview').goto_preview_definition()<CR>", "Goto Preview" }
|
||||
-- lvim.builtin.which_key.mappings["P"] = { "<cmd>Telescope project<CR>", "Projects" }
|
||||
|
||||
-- term stuff (there is probably something better)
|
||||
-- vim.api.nvim_set_keymap("n", "<Leader>t", [[<cmd>vnew term://zsh | vertical resize 87 <CR>]],
|
||||
-- {silent = true}) -- term over right
|
||||
|
||||
-- vertical terminal
|
||||
-- vim.api.nvim_set_keymap("n", "<Leader>t", [[<cmd> split term://zsh | resize 28 <CR>]],
|
||||
-- {silent = true}) -- term bottom
|
||||
|
||||
Reference in New Issue
Block a user