mirror of
https://github.com/tedkulp/dotfiles
synced 2026-03-05 13:40:18 -05:00
chore: cleanup, added neorg
This commit is contained in:
@@ -1,30 +1,21 @@
|
||||
local utils = require "lvim.utils"
|
||||
|
||||
-- general
|
||||
lvim.log.level = "warn"
|
||||
-- lvim.format_on_save = true
|
||||
lvim.colorscheme = "tokyonight"
|
||||
-- to disable icons and use a minimalist setup, uncomment the following
|
||||
-- lvim.use_icons = false
|
||||
lvim.colorscheme = "dracula"
|
||||
vim.opt.clipboard = "unnamed,unnamedplus"
|
||||
-- vim.opt.list = true
|
||||
-- vim.opt.listchars:append("eol:↴")
|
||||
vim.opt.guifont = "JetBrainsMono Nerd Font Mono:h12"
|
||||
|
||||
-- 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.builtin.which_key.mappings['W'] = { ":w<cr>", "Save Buffer" }
|
||||
lvim.format_on_save = {
|
||||
timeout = 5000,
|
||||
}
|
||||
lvim.builtin.lualine.options.theme = "tokyonight"
|
||||
lvim.builtin.lualine.options.theme = "dracula-nvim"
|
||||
lvim.builtin.bufferline.options.show_buffer_close_icons = false
|
||||
lvim.builtin.bufferline.options.numbers = "buffer_id"
|
||||
lvim.builtin.bufferline.options.separator_style = "slant"
|
||||
|
||||
-- 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>")
|
||||
vim.keymap.set("i", "jj", "<nop>")
|
||||
vim.keymap.set("i", "jk", "<nop>")
|
||||
@@ -32,8 +23,6 @@ vim.keymap.set("i", "kj", "<nop>")
|
||||
vim.opt.cursorline = true
|
||||
vim.opt.relativenumber = true
|
||||
|
||||
-- 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.
|
||||
local _, actions = pcall(require, "telescope.actions")
|
||||
lvim.builtin.telescope.defaults.mappings = {
|
||||
-- for input mode
|
||||
@@ -50,8 +39,6 @@ lvim.builtin.telescope.defaults.mappings = {
|
||||
},
|
||||
}
|
||||
|
||||
-- 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" },
|
||||
@@ -69,8 +56,6 @@ lvim.builtin.which_key.mappings['w'] = {
|
||||
c = { "<cmd>close<cr>", "Close Window" },
|
||||
}
|
||||
|
||||
-- TODO: User Config for predefined plugins
|
||||
-- After changing plugin config exit and reopen LunarVim, Run :PackerInstall :PackerCompile
|
||||
lvim.builtin.alpha.active = true
|
||||
lvim.builtin.alpha.mode = "dashboard"
|
||||
lvim.builtin.notify.active = true
|
||||
@@ -78,7 +63,6 @@ lvim.builtin.terminal.active = true
|
||||
lvim.builtin.nvimtree.setup.view.side = "left"
|
||||
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 = {
|
||||
"bash",
|
||||
"c",
|
||||
@@ -92,99 +76,28 @@ lvim.builtin.treesitter.ensure_installed = {
|
||||
"rust",
|
||||
"java",
|
||||
"yaml",
|
||||
"norg",
|
||||
}
|
||||
|
||||
lvim.builtin.treesitter.ignore_install = { "haskell" }
|
||||
lvim.builtin.treesitter.highlight.enabled = true
|
||||
|
||||
-- generic LSP settings
|
||||
|
||||
-- ---@usage disable automatic installation of servers
|
||||
-- lvim.lsp.automatic_servers_installation = false
|
||||
|
||||
-- ---configure a server manually. !!Requires `:LvimCacheReset` to take effect!!
|
||||
-- ---see the full default list `:lua print(vim.inspect(lvim.lsp.automatic_configuration.skipped_servers))`
|
||||
-- vim.list_extend(lvim.lsp.automatic_configuration.skipped_servers, { "pyright" })
|
||||
-- local opts = {} -- check the lspconfig documentation for a list of all possible options
|
||||
-- require("lvim.lsp.manager").setup("pyright", opts)
|
||||
|
||||
-- ---remove a server from the skipped list, e.g. eslint, or emmet_ls. !!Requires `:LvimCacheReset` to take effect!!
|
||||
-- ---`:LvimInfo` lists which server(s) are skiipped for the current filetype
|
||||
-- vim.tbl_map(function(server)
|
||||
-- return server ~= "emmet_ls"
|
||||
-- end, lvim.lsp.automatic_configuration.skipped_servers)
|
||||
|
||||
-- -- you can set a custom on_attach function that will be used for all the language servers
|
||||
-- -- See <https://github.com/neovim/nvim-lspconfig#keybindings-and-completion>
|
||||
-- lvim.lsp.on_attach_callback = function(client, bufnr)
|
||||
-- local function buf_set_option(...)
|
||||
-- vim.api.nvim_buf_set_option(bufnr, ...)
|
||||
-- end
|
||||
-- --Enable completion triggered by <c-x><c-o>
|
||||
-- buf_set_option("omnifunc", "v:lua.vim.lsp.omnifunc")
|
||||
-- end
|
||||
|
||||
-- -- set a formatter, this will override the language server formatting capabilities (if it exists)
|
||||
-- local formatters = require "lvim.lsp.null-ls.formatters"
|
||||
-- formatters.setup {
|
||||
-- { command = "black", filetypes = { "python" } },
|
||||
-- { command = "isort", filetypes = { "python" } },
|
||||
-- {
|
||||
-- -- each formatter accepts a list of options identical to https://github.com/jose-elias-alvarez/null-ls.nvim/blob/main/doc/BUILTINS.md#Configuration
|
||||
-- command = "prettier",
|
||||
-- ---@usage arguments to pass to the formatter
|
||||
-- -- these cannot contain whitespaces, options such as `--line-width 80` become either `{'--line-width', '80'}` or `{'--line-width=80'}`
|
||||
-- extra_args = { "--print-with", "100" },
|
||||
-- ---@usage specify which filetypes to enable. By default a providers will attach to all the filetypes it supports.
|
||||
-- filetypes = { "typescript", "typescriptreact" },
|
||||
-- },
|
||||
-- }
|
||||
|
||||
-- -- set additional linters
|
||||
-- local linters = require "lvim.lsp.null-ls.linters"
|
||||
-- linters.setup {
|
||||
-- { command = "flake8", filetypes = { "python" } },
|
||||
-- {
|
||||
-- -- each linter accepts a list of options identical to https://github.com/jose-elias-alvarez/null-ls.nvim/blob/main/doc/BUILTINS.md#Configuration
|
||||
-- command = "shellcheck",
|
||||
-- ---@usage arguments to pass to the formatter
|
||||
-- -- these cannot contain whitespaces, options such as `--line-width 80` become either `{'--line-width', '80'}` or `{'--line-width=80'}`
|
||||
-- extra_args = { "--severity", "warning" },
|
||||
-- },
|
||||
-- {
|
||||
-- command = "codespell",
|
||||
-- ---@usage specify which filetypes to enable. By default a providers will attach to all the filetypes it supports.
|
||||
-- filetypes = { "javascript", "python" },
|
||||
-- },
|
||||
-- }
|
||||
|
||||
-- Additional Plugins
|
||||
-- lvim.plugins = {
|
||||
-- {"folke/tokyonight.nvim"},
|
||||
-- {
|
||||
-- "folke/trouble.nvim",
|
||||
-- cmd = "TroubleToggle",
|
||||
-- },
|
||||
-- }
|
||||
|
||||
-- Autocommands (https://neovim.io/doc/user/autocmd.html)
|
||||
-- vim.api.nvim_create_autocmd("BufEnter", {
|
||||
-- pattern = { "*.json", "*.jsonc" },
|
||||
-- -- enable wrap mode for json files only
|
||||
-- command = "setlocal wrap",
|
||||
-- })
|
||||
-- vim.api.nvim_create_autocmd("FileType", {
|
||||
-- pattern = "zsh",
|
||||
-- callback = function()
|
||||
-- -- let treesitter use bash highlight for zsh files as well
|
||||
-- require("nvim-treesitter.highlight").attach(0, "bash")
|
||||
-- end,
|
||||
-- })
|
||||
|
||||
lvim.plugins = {
|
||||
{
|
||||
"folke/tokyonight.nvim",
|
||||
},
|
||||
{
|
||||
"rebelot/kanagawa.nvim",
|
||||
},
|
||||
{
|
||||
"lunarvim/horizon.nvim",
|
||||
},
|
||||
{
|
||||
"Mofiqul/dracula.nvim",
|
||||
config = function()
|
||||
vim.g.dracula_show_end_of_buffer = true
|
||||
vim.g.dracula_italic_comment = true
|
||||
end,
|
||||
},
|
||||
{
|
||||
"chiedo/vim-case-convert"
|
||||
},
|
||||
@@ -268,25 +181,16 @@ lvim.plugins = {
|
||||
},
|
||||
})
|
||||
end,
|
||||
|
||||
},
|
||||
{
|
||||
"tpope/vim-repeat"
|
||||
},
|
||||
{
|
||||
"ethanholz/nvim-lastplace",
|
||||
event = "BufRead",
|
||||
"vladdoster/remember.nvim",
|
||||
config = function()
|
||||
require("nvim-lastplace").setup({
|
||||
lastplace_ignore_buftype = { "quickfix", "nofile", "help" },
|
||||
lastplace_ignore_filetype = {
|
||||
"gitcommit",
|
||||
"gitrebase",
|
||||
"svn",
|
||||
"hgcommit",
|
||||
},
|
||||
lastplace_open_folds = true,
|
||||
})
|
||||
require("remember").setup {
|
||||
open_folds = true,
|
||||
}
|
||||
end,
|
||||
},
|
||||
{
|
||||
@@ -330,7 +234,7 @@ lvim.plugins = {
|
||||
event = "BufRead",
|
||||
config = function()
|
||||
require("spectre").setup()
|
||||
lvim.builtin.which_key.mappings["S"] = { "<cmd>lua require('spectre').open()<CR>", "Spectre Search" }
|
||||
lvim.builtin.which_key.mappings["sS"] = { "<cmd>lua require('spectre').open()<CR>", "Spectre Search" }
|
||||
end,
|
||||
},
|
||||
{
|
||||
@@ -432,12 +336,46 @@ lvim.plugins = {
|
||||
vim.keymap.set("i", "<A-i>", "<cmd>PickEverythingInsert<cr>", { noremap = true, silent = true }) -- opt-i on Mac
|
||||
end,
|
||||
},
|
||||
{
|
||||
"nvim-neorg/neorg",
|
||||
config = function()
|
||||
require('neorg').setup {
|
||||
load = {
|
||||
["core.defaults"] = {},
|
||||
["core.norg.concealer"] = {},
|
||||
["core.norg.completion"] = {
|
||||
config = {
|
||||
engine = "nvim-cmp",
|
||||
},
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
vim.list_extend(lvim.builtin.cmp.sources, {
|
||||
{ name = "neorg" },
|
||||
})
|
||||
end,
|
||||
requires = "nvim-lua/plenary.nvim",
|
||||
},
|
||||
}
|
||||
|
||||
-- luasnip jumps
|
||||
vim.keymap.set("i", "<c-;>", "<cmd>lua require('luasnip').jump(1)<cr>", { noremap = true, silent = true })
|
||||
vim.keymap.set("i", "<c-l>", "<cmd>lua require('luasnip').jump(-1)<cr>", { noremap = true, silent = true })
|
||||
|
||||
function Dump(o)
|
||||
if type(o) == 'table' then
|
||||
local s = '{ '
|
||||
for k, v in pairs(o) do
|
||||
if type(k) ~= 'number' then k = '"' .. k .. '"' end
|
||||
s = s .. '[' .. k .. '] = ' .. Dump(v) .. ','
|
||||
end
|
||||
return s .. '} '
|
||||
else
|
||||
return tostring(o)
|
||||
end
|
||||
end
|
||||
|
||||
-- set additional formatters
|
||||
local formatters = require "lvim.lsp.null-ls.formatters"
|
||||
formatters.setup {
|
||||
|
||||
Reference in New Issue
Block a user