nvim + tmux tweaks
This commit is contained in:
+30
-38
@@ -77,7 +77,6 @@ vim.opt.splitkeep = "screen"
|
|||||||
vim.opt.splitright = true
|
vim.opt.splitright = true
|
||||||
|
|
||||||
-- Terminal & Status Column
|
-- Terminal & Status Column
|
||||||
vim.opt.termguicolors = true
|
|
||||||
vim.opt.number = true
|
vim.opt.number = true
|
||||||
vim.opt.relativenumber = true
|
vim.opt.relativenumber = true
|
||||||
vim.diagnostic.config({
|
vim.diagnostic.config({
|
||||||
@@ -99,7 +98,7 @@ vim.diagnostic.config({
|
|||||||
float = { source = true },
|
float = { source = true },
|
||||||
})
|
})
|
||||||
|
|
||||||
vim.api.nvim_create_autocmd("FileType", {
|
vim.api.nvim_create_autocmd("BufEnter", {
|
||||||
desc = "Disable auto-commenting on new line",
|
desc = "Disable auto-commenting on new line",
|
||||||
pattern = "*",
|
pattern = "*",
|
||||||
callback = function() vim.opt_local.formatoptions:remove({ "r", "o" }) end,
|
callback = function() vim.opt_local.formatoptions:remove({ "r", "o" }) end,
|
||||||
@@ -234,6 +233,8 @@ map("n", "gl", vim.diagnostic.setloclist, { desc = "Diagnostics to Location List
|
|||||||
vim.api.nvim_create_autocmd("LspAttach", {
|
vim.api.nvim_create_autocmd("LspAttach", {
|
||||||
group = vim.api.nvim_create_augroup("UserLspConfig", {}),
|
group = vim.api.nvim_create_augroup("UserLspConfig", {}),
|
||||||
callback = function(ev)
|
callback = function(ev)
|
||||||
|
vim.bo[ev.buf].omnifunc = "v:lua.vim.lsp.omnifunc"
|
||||||
|
|
||||||
local bmap = function(mode, keys, func, desc) vim.keymap.set(mode, keys, func, { buffer = ev.buf, desc = desc }) end
|
local bmap = function(mode, keys, func, desc) vim.keymap.set(mode, keys, func, { buffer = ev.buf, desc = desc }) end
|
||||||
|
|
||||||
bmap("n", "gd", vim.lsp.buf.definition, "Goto Definition")
|
bmap("n", "gd", vim.lsp.buf.definition, "Goto Definition")
|
||||||
@@ -337,7 +338,6 @@ end, { nargs = 1 })
|
|||||||
local function makespecs_themes()
|
local function makespecs_themes()
|
||||||
return {
|
return {
|
||||||
"junegunn/seoul256.vim",
|
"junegunn/seoul256.vim",
|
||||||
"mcauley-penney/phobos-anomaly.nvim",
|
|
||||||
"folke/tokyonight.nvim",
|
"folke/tokyonight.nvim",
|
||||||
{
|
{
|
||||||
"uloco/bluloco.nvim",
|
"uloco/bluloco.nvim",
|
||||||
@@ -359,21 +359,18 @@ local function makespec_lspconfig()
|
|||||||
on_dir(require("lspconfig").util.root_pattern(unpack(root_markers))(vim.fn.bufname(bufnr)))
|
on_dir(require("lspconfig").util.root_pattern(unpack(root_markers))(vim.fn.bufname(bufnr)))
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
return {
|
return {
|
||||||
"neovim/nvim-lspconfig",
|
"neovim/nvim-lspconfig",
|
||||||
lazy = false,
|
lazy = false,
|
||||||
event = { "BufReadPost", "BufNewFile" },
|
event = { "BufReadPost", "BufNewFile" },
|
||||||
cmd = { "LspInfo", "LspRestart", "LspStart", "LspStop" },
|
keys = { { "<F4>", "<cmd>checkhealth vim.lsp<cr>", noremap = true, desc = "LSP Info" } },
|
||||||
keys = { { "<F4>", "<cmd>LspInfo<cr>", noremap = true } },
|
|
||||||
config = function()
|
config = function()
|
||||||
|
-- Lua
|
||||||
vim.lsp.config("lua_ls", {
|
vim.lsp.config("lua_ls", {
|
||||||
cmd = { "lua-language-server" },
|
|
||||||
settings = {
|
settings = {
|
||||||
Lua = {
|
Lua = {
|
||||||
workspace = {
|
workspace = { checkThirdParty = false, library = { vim.env.VIMRUNTIME } },
|
||||||
checkThirdParty = false,
|
|
||||||
library = { vim.env.VIMRUNTIME },
|
|
||||||
},
|
|
||||||
telemetry = { enable = false },
|
telemetry = { enable = false },
|
||||||
diagnostics = { globals = { "vim" } },
|
diagnostics = { globals = { "vim" } },
|
||||||
format = { enable = false },
|
format = { enable = false },
|
||||||
@@ -409,7 +406,7 @@ local function makespec_lspconfig()
|
|||||||
vim.lsp.config("yamlls", {
|
vim.lsp.config("yamlls", {
|
||||||
settings = {
|
settings = {
|
||||||
yaml = {
|
yaml = {
|
||||||
schemas = { kubernetes = "/home/hjalmarlucius/src/hjarl/system/manifests/*.yaml" },
|
schemas = { kubernetes = vim.fn.expand("~/src/hjarl/system/manifests/*.yaml") },
|
||||||
-- schemaStore = { enable = false, url = "" },
|
-- schemaStore = { enable = false, url = "" },
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
@@ -431,10 +428,7 @@ local function makespec_lspconfig()
|
|||||||
settings = {
|
settings = {
|
||||||
pylsp = {
|
pylsp = {
|
||||||
plugins = {
|
plugins = {
|
||||||
pylsp_mypy = {
|
pylsp_mypy = { enabled = true, dmypy = true },
|
||||||
enabled = true,
|
|
||||||
dmypy = true,
|
|
||||||
},
|
|
||||||
pycodestyle = { enabled = false },
|
pycodestyle = { enabled = false },
|
||||||
mccabe = { enabled = false },
|
mccabe = { enabled = false },
|
||||||
},
|
},
|
||||||
@@ -448,7 +442,6 @@ local function makespec_lspconfig()
|
|||||||
settings = {
|
settings = {
|
||||||
python = {
|
python = {
|
||||||
analysis = {
|
analysis = {
|
||||||
-- logLevel = "Trace",
|
|
||||||
autoImportCompletions = false,
|
autoImportCompletions = false,
|
||||||
diagnosticMode = "workspace",
|
diagnosticMode = "workspace",
|
||||||
logTypeEvaluationTime = true,
|
logTypeEvaluationTime = true,
|
||||||
@@ -465,16 +458,12 @@ local function makespec_lspconfig()
|
|||||||
autoUseWorkspaceTsdk = true,
|
autoUseWorkspaceTsdk = true,
|
||||||
experimental = {
|
experimental = {
|
||||||
maxInlayHintLength = 30,
|
maxInlayHintLength = 30,
|
||||||
completion = {
|
completion = { enableServerSideFuzzyMatch = true },
|
||||||
enableServerSideFuzzyMatch = true,
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
javascript = {
|
javascript = {
|
||||||
updateImportsOnFileMove = { enabled = "always" },
|
updateImportsOnFileMove = { enabled = "always" },
|
||||||
suggest = {
|
suggest = { completeFunctionCalls = true },
|
||||||
completeFunctionCalls = true,
|
|
||||||
},
|
|
||||||
inlayHints = {
|
inlayHints = {
|
||||||
enumMemberValues = { enabled = true },
|
enumMemberValues = { enabled = true },
|
||||||
functionLikeReturnTypes = { enabled = true },
|
functionLikeReturnTypes = { enabled = true },
|
||||||
@@ -486,9 +475,7 @@ local function makespec_lspconfig()
|
|||||||
},
|
},
|
||||||
typescript = {
|
typescript = {
|
||||||
updateImportsOnFileMove = { enabled = "always" },
|
updateImportsOnFileMove = { enabled = "always" },
|
||||||
suggest = {
|
suggest = { completeFunctionCalls = true },
|
||||||
completeFunctionCalls = true,
|
|
||||||
},
|
|
||||||
inlayHints = {
|
inlayHints = {
|
||||||
enumMemberValues = { enabled = true },
|
enumMemberValues = { enabled = true },
|
||||||
functionLikeReturnTypes = { enabled = true },
|
functionLikeReturnTypes = { enabled = true },
|
||||||
@@ -501,6 +488,18 @@ local function makespec_lspconfig()
|
|||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
|
||||||
|
vim.lsp.config("tinymist", {
|
||||||
|
cmd = { "tinymist" },
|
||||||
|
filetypes = { "typst" },
|
||||||
|
root_dir = rootdirfix({ ".git", "typst.toml" }),
|
||||||
|
})
|
||||||
|
|
||||||
|
vim.lsp.config("bashls", {
|
||||||
|
cmd = { "bash-language-server", "start" },
|
||||||
|
filetypes = { "sh", "bash" },
|
||||||
|
root_dir = rootdirfix({ ".git" }),
|
||||||
|
})
|
||||||
|
|
||||||
vim.lsp.enable("bashls")
|
vim.lsp.enable("bashls")
|
||||||
vim.lsp.enable("clangd")
|
vim.lsp.enable("clangd")
|
||||||
vim.lsp.enable("html")
|
vim.lsp.enable("html")
|
||||||
@@ -743,16 +742,9 @@ local function makespecs_previewers()
|
|||||||
get_root = function(filename)
|
get_root = function(filename)
|
||||||
local root = os.getenv("TYPST_ROOT")
|
local root = os.getenv("TYPST_ROOT")
|
||||||
if root then return root end
|
if root then return root end
|
||||||
local dir0 = vim.fn.fnamemodify(filename, ":p:h")
|
local git_root = vim.fs.root(filename, ".git")
|
||||||
local dir = dir0
|
if git_root then return git_root end
|
||||||
for _ = 1, 10 do
|
return vim.fn.fnamemodify(filename, ":p:h")
|
||||||
if vim.fn.isdirectory(dir .. "/.git/") ~= 0 or vim.fn.filereadable(dir .. "/.git") ~= 0 then
|
|
||||||
print("root dir: " .. dir)
|
|
||||||
return dir
|
|
||||||
end
|
|
||||||
dir = vim.fn.fnamemodify(dir, ":p:h:h")
|
|
||||||
end
|
|
||||||
return dir0
|
|
||||||
end,
|
end,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
@@ -1075,8 +1067,8 @@ local function makespec_snacks()
|
|||||||
{ "<M-f>", function() Snacks.picker.git_files() end, desc = "Find Git Files" },
|
{ "<M-f>", function() Snacks.picker.git_files() end, desc = "Find Git Files" },
|
||||||
{ "<leader>fg", function() Snacks.picker.git_files() end, desc = "Find Git Files" },
|
{ "<leader>fg", function() Snacks.picker.git_files() end, desc = "Find Git Files" },
|
||||||
{ "<leader>fa", function() Snacks.picker.files() end, desc = "Find Files" },
|
{ "<leader>fa", function() Snacks.picker.files() end, desc = "Find Files" },
|
||||||
{ "<leader>fc", function() Snacks.picker.files({ cwd = "/home/hjalmarlucius/dotfiles", title="Find Configs" }) end, desc = "Find Config" },
|
{ "<leader>fc", function() Snacks.picker.files({ cwd = vim.fn.expand("~/dotfiles"), title="Find Configs" }) end, desc = "Find Config" },
|
||||||
{ "<leader>fn", function() Snacks.picker.files({ cwd = "/home/hjalmarlucius/notes", title="Find Notes" }) end, desc = "Find Note", },
|
{ "<leader>fn", function() Snacks.picker.files({ cwd = vim.fn.expand("~/notes"), title="Find Notes" }) end, desc = "Find Note", },
|
||||||
-- logs
|
-- logs
|
||||||
{ "<leader>ll", function() Snacks.notifier.show_history() end, desc = "Notification History" },
|
{ "<leader>ll", function() Snacks.notifier.show_history() end, desc = "Notification History" },
|
||||||
-- code
|
-- code
|
||||||
@@ -1714,4 +1706,4 @@ require("lazy").setup({
|
|||||||
spec = lazyspecs,
|
spec = lazyspecs,
|
||||||
checker = { enabled = true },
|
checker = { enabled = true },
|
||||||
})
|
})
|
||||||
vim.cmd("colorscheme catppuccin-nvim")
|
vim.cmd("colorscheme catppuccin")
|
||||||
|
|||||||
@@ -104,6 +104,10 @@ bind t clock-mode
|
|||||||
|
|
||||||
# Show pane numbers
|
# Show pane numbers
|
||||||
bind i display-panes
|
bind i display-panes
|
||||||
|
ps_pid='#(pgrep -P "#{pane_pid}" | tr "\n" " ")'
|
||||||
|
cmd='#(ps --no-headers -o args $(pgrep -P "#{pane_pid}"))'
|
||||||
|
bind P display-message -d 100000 "${cmd} FOLDER:#{pane_current_path} CMD:#{=/-20/…:pane_current_command} PID:${ps_pid}"
|
||||||
|
|
||||||
|
|
||||||
# Config Reloads
|
# Config Reloads
|
||||||
bind r source-file ~/.config/tmux/tmux.conf \; refresh-client \; display-message "Config reloaded"
|
bind r source-file ~/.config/tmux/tmux.conf \; refresh-client \; display-message "Config reloaded"
|
||||||
|
|||||||
Reference in New Issue
Block a user