mirror of
https://github.com/tedkulp/dotfiles
synced 2026-03-05 13:40:18 -05:00
Updated lvim config
This commit is contained in:
@@ -12,30 +12,34 @@ an executable
|
||||
lvim.log.level = "warn"
|
||||
lvim.format_on_save = true
|
||||
lvim.colorscheme = "onedarker"
|
||||
vim.opt.clipboard = "unnamedplus"
|
||||
vim.opt.clipboard = "unnamed,unnamedplus"
|
||||
|
||||
-- keymappings [view all the defaults by pressing <leader>Lk]
|
||||
lvim.leader = "space"
|
||||
-- add your own keymapping
|
||||
lvim.keys.normal_mode["<C-s>"] = ":w<cr>"
|
||||
|
||||
-- unmap a default keymapping
|
||||
-- lvim.keys.normal_mode["<C-Up>"] = ""
|
||||
-- edit a default keymapping
|
||||
-- lvim.keys.normal_mode["<C-q>"] = ":q<cr>"
|
||||
|
||||
-- Change Telescope navigation to use j and k for navigation and n and p for history in both input and normal mode.
|
||||
-- lvim.builtin.telescope.on_config_done = function()
|
||||
-- local actions = require "telescope.actions"
|
||||
-- -- for input mode
|
||||
-- lvim.builtin.telescope.defaults.mappings.i["<C-j>"] = actions.move_selection_next
|
||||
-- lvim.builtin.telescope.defaults.mappings.i["<C-n>"] = actions.cycle_history_next
|
||||
-- lvim.builtin.telescope.defaults.mappings.i["<C-k>"] = actions.move_selection_previous
|
||||
-- lvim.builtin.telescope.defaults.mappings.i["<C-p>"] = actions.cycle_history_prev
|
||||
-- -- for normal mode
|
||||
-- lvim.builtin.telescope.defaults.mappings.n["<C-j>"] = actions.move_selection_next
|
||||
-- lvim.builtin.telescope.defaults.mappings.n["<C-k>"] = actions.move_selection_previous
|
||||
-- end
|
||||
-- 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
|
||||
i = {
|
||||
["<C-j>"] = actions.move_selection_next,
|
||||
["<C-k>"] = actions.move_selection_previous,
|
||||
["<C-n>"] = actions.cycle_history_next,
|
||||
["<C-p>"] = actions.cycle_history_prev,
|
||||
},
|
||||
-- for normal mode
|
||||
n = {
|
||||
["<C-j>"] = actions.move_selection_next,
|
||||
["<C-k>"] = actions.move_selection_previous,
|
||||
},
|
||||
}
|
||||
|
||||
-- Use which-key to add extra bindings with the leader-key prefix
|
||||
-- lvim.builtin.which_key.mappings["P"] = { "<cmd>Telescope projects<CR>", "Projects" }
|
||||
@@ -53,18 +57,43 @@ lvim.keys.normal_mode["<C-s>"] = ":w<cr>"
|
||||
-- After changing plugin config exit and reopen LunarVim, Run :PackerInstall :PackerCompile
|
||||
lvim.builtin.dashboard.active = true
|
||||
lvim.builtin.terminal.active = true
|
||||
lvim.builtin.lualine.active = true
|
||||
lvim.builtin.dap.active = true
|
||||
-- lvim.builtin.bufferline = true
|
||||
lvim.builtin.nvimtree.side = "left"
|
||||
lvim.builtin.nvimtree.show_icons.git = 1
|
||||
lvim.builtin.nvimtree.setup.view.side = "left"
|
||||
lvim.builtin.nvimtree.show_icons.git = 0
|
||||
|
||||
-- if you don't want all the parsers change this to a table of the ones you want
|
||||
lvim.builtin.treesitter.ensure_installed = "maintained"
|
||||
lvim.builtin.treesitter.ensure_installed = {
|
||||
"bash",
|
||||
"c",
|
||||
"javascript",
|
||||
"json",
|
||||
"lua",
|
||||
"python",
|
||||
"typescript",
|
||||
"css",
|
||||
"rust",
|
||||
"java",
|
||||
"yaml",
|
||||
"go",
|
||||
}
|
||||
|
||||
lvim.builtin.treesitter.ignore_install = { "haskell" }
|
||||
lvim.builtin.treesitter.highlight.enabled = true
|
||||
|
||||
lvim.lsp.automatic_servers_installation = true
|
||||
|
||||
-- generic LSP settings
|
||||
|
||||
-- ---@usage disable automatic installation of servers
|
||||
-- lvim.lsp.automatic_servers_installation = false
|
||||
|
||||
-- ---@usage Select which servers should be configured manually. Requires `:LvimCacheRest` to take effect.
|
||||
-- See the full default list `:lua print(vim.inspect(lvim.lsp.override))`
|
||||
-- vim.list_extend(lvim.lsp.override, { "pyright" })
|
||||
|
||||
-- ---@usage setup a server -- see: https://www.lunarvim.org/languages/#overriding-the-default-configuration
|
||||
-- local opts = {} -- check the lspconfig documentation for a list of all possible options
|
||||
-- require("lvim.lsp.manager").setup("pylsp", opts)
|
||||
|
||||
-- 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)
|
||||
@@ -90,22 +119,52 @@ lvim.builtin.treesitter.highlight.enabled = true
|
||||
-- end
|
||||
-- end
|
||||
|
||||
-- set a formatter if you want to override the default lsp one (if it exists)
|
||||
-- lvim.lang.python.formatters = {
|
||||
-- -- set a formatter, this will override the language server formatting capabilities (if it exists)
|
||||
-- local formatters = require "lvim.lsp.null-ls.formatters"
|
||||
-- formatters.setup {
|
||||
-- { exe = "black", filetypes = { "python" } },
|
||||
-- { exe = "isort", filetypes = { "python" } },
|
||||
-- {
|
||||
-- exe = "black",
|
||||
-- }
|
||||
-- }
|
||||
-- set an additional linter
|
||||
-- lvim.lang.python.linters = {
|
||||
-- {
|
||||
-- exe = "flake8",
|
||||
-- }
|
||||
-- exe = "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'}`
|
||||
-- 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" },
|
||||
-- },
|
||||
-- }
|
||||
|
||||
vim.cmd("set timeoutlen=500")
|
||||
-- -- set additional linters
|
||||
-- local linters = require "lvim.lsp.null-ls.linters"
|
||||
-- linters.setup {
|
||||
-- { exe = "flake8", filetypes = { "python" } },
|
||||
-- {
|
||||
-- exe = "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'}`
|
||||
-- args = { "--severity", "warning" },
|
||||
-- },
|
||||
-- {
|
||||
-- exe = "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)
|
||||
-- lvim.autocommands.custom_groups = {
|
||||
-- { "BufWinEnter", "*.lua", "setlocal ts=8 sw=8" },
|
||||
-- }
|
||||
|
||||
lvim.plugins = {
|
||||
{
|
||||
"tpope/vim-surround",
|
||||
@@ -142,6 +201,15 @@ lvim.plugins = {
|
||||
{
|
||||
"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",
|
||||
@@ -199,25 +267,37 @@ lvim.plugins = {
|
||||
table.insert(dial.config.searchlist.normal, "custom#Boolean")
|
||||
end,
|
||||
},
|
||||
{
|
||||
"mrjones2014/dash.nvim",
|
||||
run = "make install",
|
||||
},
|
||||
}
|
||||
|
||||
-- Autocommands (https://neovim.io/doc/user/autocmd.html)
|
||||
-- lvim.autocommands.custom_groups = {
|
||||
-- { "BufWinEnter", "*.lua", "setlocal ts=8 sw=8" },
|
||||
-- }
|
||||
local formatters = require "lvim.lsp.null-ls.formatters"
|
||||
formatters.setup {
|
||||
{
|
||||
exe = "prettier",
|
||||
filetypes = { "typescript", "typescriptreact", "javascript", "javascriptreact", "json" },
|
||||
},
|
||||
{
|
||||
exe = "eslint",
|
||||
filetypes = { "typescript", "typescriptreact", "javascript", "javascriptreact" },
|
||||
},
|
||||
{
|
||||
exe = "rustfmt",
|
||||
filetypes = { "rust" },
|
||||
},
|
||||
{
|
||||
exe = "gofmt",
|
||||
filetypes = { "go" },
|
||||
},
|
||||
}
|
||||
|
||||
-- Typescript/javascript
|
||||
lvim.lang.typescript.formatters = { { exe = "eslint" }, { exe = "prettier" } }
|
||||
lvim.lang.typescriptreact.formatters = lvim.lang.typescript.formatters
|
||||
lvim.lang.typescript.linters = { { exe = "eslint" } }
|
||||
lvim.lang.typescriptreact.linters = lvim.lang.typescript.linters
|
||||
lvim.lang.javascript.formatters = { { exe = "eslint" }, { exe = "prettier" } }
|
||||
lvim.lang.javascriptreact.formatters = lvim.lang.javascript.formatters
|
||||
lvim.lang.javascript.linters = { { exe = "eslint" } }
|
||||
lvim.lang.javascriptreact.linters = lvim.lang.javascript.linters
|
||||
|
||||
-- JSON
|
||||
lvim.lang.json.formatters = { { exe = "prettier" } }
|
||||
|
||||
-- Lua
|
||||
lvim.lang.lua.formatters = { { exe = "stylua" } }
|
||||
-- set additional linters
|
||||
local linters = require "lvim.lsp.null-ls.linters"
|
||||
linters.setup {
|
||||
{
|
||||
exe = "eslint",
|
||||
filetypes = { "typescript", "typescriptreact", "javascript", "javascriptreact" },
|
||||
},
|
||||
}
|
||||
|
||||
@@ -18,6 +18,8 @@ alias gie='git init && git commit --allow-empty -m "Initial commit"'
|
||||
alias grc="git branch --merged | grep -v '\*' | grep -v master | grep -v stage | xargs -n 1 git branch -d"
|
||||
alias grcr="git fetch --all -p && git branch -r --merged | grep -v '\*' | grep origin | grep -v master | grep -v stage | sed 's/origin\//:/' | xargs -n 1 echo git push origin"
|
||||
|
||||
alias lg="lazygit"
|
||||
|
||||
krak () {
|
||||
dir="$(cd "$(dirname "$1")"; pwd -P)/$(basename "$1")"
|
||||
open gitkraken://repo/$dir
|
||||
|
||||
@@ -1 +1,2 @@
|
||||
alias xssh="xpanes --ssh"
|
||||
alias tmux="tmux -2"
|
||||
|
||||
Reference in New Issue
Block a user