Compare commits
4 Commits
4d6a5a431c
...
4aa0c54fc4
Author | SHA1 | Date | |
---|---|---|---|
4aa0c54fc4 | |||
5870ed5fc5 | |||
1805645694 | |||
d134abbfda |
@ -12,34 +12,32 @@ end
|
||||
|
||||
-- Handy VSCode Shortcuts
|
||||
-- Move lines up and down
|
||||
vim.api.nvim_set_keymap('n', '<A-Up>', ':m .-2<CR>==', { noremap = true, silent = true })
|
||||
vim.api.nvim_set_keymap('n', '<A-Down>', ':m .+1<CR>==', { noremap = true, silent = true })
|
||||
vim.api.nvim_set_keymap('n', '<A-k>', '<Esc>:m .-2<CR>', { noremap = true, silent = true })
|
||||
vim.api.nvim_set_keymap('n', '<A-j>', '<Esc>:m .+1<CR>', { noremap = true, silent = true })
|
||||
vim.api.nvim_set_keymap("n", "<A-Up>", ":m .-2<CR>==", { noremap = true, silent = true })
|
||||
vim.api.nvim_set_keymap("n", "<A-Down>", ":m .+1<CR>==", { noremap = true, silent = true })
|
||||
vim.api.nvim_set_keymap("n", "<A-k>", "<Esc>:m .-2<CR>", { noremap = true, silent = true })
|
||||
vim.api.nvim_set_keymap("n", "<A-j>", "<Esc>:m .+1<CR>", { noremap = true, silent = true })
|
||||
|
||||
-- Move lines in insert mode
|
||||
vim.api.nvim_set_keymap('i', '<A-Up>', '<Esc>:m .-2<CR>i', { noremap = true, silent = true })
|
||||
vim.api.nvim_set_keymap('i', '<A-Down>', '<Esc>:m .+1<CR>i', { noremap = true, silent = true })
|
||||
vim.api.nvim_set_keymap('i', '<A-k>', '<Esc>:m .-2<CR>i', { noremap = true, silent = true })
|
||||
vim.api.nvim_set_keymap('i', '<A-j>', '<Esc>:m .+1<CR>i', { noremap = true, silent = true })
|
||||
vim.api.nvim_set_keymap("i", "<A-Up>", "<Esc>:m .-2<CR>i", { noremap = true, silent = true })
|
||||
vim.api.nvim_set_keymap("i", "<A-Down>", "<Esc>:m .+1<CR>i", { noremap = true, silent = true })
|
||||
vim.api.nvim_set_keymap("i", "<A-k>", "<Esc>:m .-2<CR>i", { noremap = true, silent = true })
|
||||
vim.api.nvim_set_keymap("i", "<A-j>", "<Esc>:m .+1<CR>i", { noremap = true, silent = true })
|
||||
|
||||
-- Copy lines up and down in normal mode
|
||||
vim.api.nvim_set_keymap('n', '<C-A-S-Up>', ':t .-1<CR>', { noremap = true, silent = true })
|
||||
vim.api.nvim_set_keymap('n', '<C-A-S-Down>', ':t .-1<CR>', { noremap = true, silent = true })
|
||||
vim.api.nvim_set_keymap('n', '<C-A-S-k>', ':t .-1<CR>', { noremap = true, silent = true })
|
||||
vim.api.nvim_set_keymap('n', '<C-A-S-j>', ':t .<CR>', { noremap = true, silent = true })
|
||||
vim.api.nvim_set_keymap("n", "<C-A-S-Up>", ":t .-1<CR>", { noremap = true, silent = true })
|
||||
vim.api.nvim_set_keymap("n", "<C-A-S-Down>", ":t .-1<CR>", { noremap = true, silent = true })
|
||||
vim.api.nvim_set_keymap("n", "<C-A-S-k>", ":t .-1<CR>", { noremap = true, silent = true })
|
||||
vim.api.nvim_set_keymap("n", "<C-A-S-j>", ":t .<CR>", { noremap = true, silent = true })
|
||||
|
||||
-- Copy lines up and down in insert mode
|
||||
vim.api.nvim_set_keymap('i', '<C-A-S-Up>', '<Esc>:t.-1<CR>i', { noremap = true, silent = true })
|
||||
vim.api.nvim_set_keymap('i', '<C-A-S-Down>', '<Esc>:t.<CR>i', { noremap = true, silent = true })
|
||||
vim.api.nvim_set_keymap('i', '<C-A-S-k>', '<Esc>:t.-1<CR>i', { noremap = true, silent = true })
|
||||
vim.api.nvim_set_keymap('i', '<C-A-S-j>', '<Esc>:t.<CR>i', { noremap = true, silent = true })
|
||||
|
||||
vim.api.nvim_set_keymap("i", "<C-A-S-Up>", "<Esc>:t.-1<CR>i", { noremap = true, silent = true })
|
||||
vim.api.nvim_set_keymap("i", "<C-A-S-Down>", "<Esc>:t.<CR>i", { noremap = true, silent = true })
|
||||
vim.api.nvim_set_keymap("i", "<C-A-S-k>", "<Esc>:t.-1<CR>i", { noremap = true, silent = true })
|
||||
vim.api.nvim_set_keymap("i", "<C-A-S-j>", "<Esc>:t.<CR>i", { noremap = true, silent = true })
|
||||
|
||||
-- Keep selection in visual mode when indenting
|
||||
vim.api.nvim_set_keymap('v', '<', '<gv', { noremap = true, silent = true })
|
||||
vim.api.nvim_set_keymap('v', '>', '>gv', { noremap = true, silent = true })
|
||||
|
||||
vim.api.nvim_set_keymap("v", "<", "<gv", { noremap = true, silent = true })
|
||||
vim.api.nvim_set_keymap("v", ">", ">gv", { noremap = true, silent = true })
|
||||
|
||||
-- Save and quit (sudo and no sudo)
|
||||
keymap.set("n", "E", ":wq!<CR>", opts("write and quit file"))
|
||||
@ -55,12 +53,12 @@ keymap.set("n", "<leader>dd", ":t.<CR>", opts("Duplicate line"))
|
||||
keymap.set("n", "<C-b>", ":wincmd p<CR>", opts("Cycle focus"))
|
||||
|
||||
-- Key Mappings for LaTeX workflow
|
||||
keymap.set('n', '<leader>lc', ':VimtexCompile<CR>', opts("Compile latex document")) -- Compile LaTeX file
|
||||
keymap.set('n', '<leader>lv', ':VimtexView<CR>', opts("View compiled latex pdf")) -- View compiled PDF
|
||||
keymap.set('n', '<leader>lq', ':VimtexStop<CR>', opts("Stop Compiling document")) -- Stop compilation
|
||||
keymap.set("n", "<leader>lc", ":VimtexCompile<CR>", opts("Compile latex document")) -- Compile LaTeX file
|
||||
keymap.set("n", "<leader>lv", ":VimtexView<CR>", opts("View compiled latex pdf")) -- View compiled PDF
|
||||
keymap.set("n", "<leader>lq", ":VimtexStop<CR>", opts("Stop Compiling document")) -- Stop compilation
|
||||
|
||||
-- Markdown-Preview
|
||||
keymap.set('n', '<leader><leader>m', ':MarkdownPreview<CR>', opts("Preview Markdown document in browser")) -- Stop compilation
|
||||
keymap.set("n", "<leader><leader>m", ":MarkdownPreview<CR>", opts("Preview Markdown document in browser")) -- Stop compilation
|
||||
|
||||
-- window navigation
|
||||
keymap.set("n", "<A-h>", "<C-w>h", opts())
|
||||
@ -87,8 +85,18 @@ keymap.set("n", "<leader><leader>r", ":!%:p", opts("run current file with argume
|
||||
keymap.set("n", "<leader>m", ":!chmod +x %:p<CR>", opts("make current file executable"))
|
||||
|
||||
-- script setup
|
||||
keymap.set("n", "<leader>#", ":w<CR>:!chmod +x %:p<CR>ggi#!/bin/sh<CR><CR><Esc>:setfiletype bash<CR>", opts("setup sh script"))
|
||||
keymap.set("n", "<leader><leader>#", ":set syntax=python<CR>:w<CR>:!chmod +x %:p<CR>:LspStart pyright<CR>i#!/usr/bin/env python3<CR><CR>", opts("setup python script"))
|
||||
keymap.set(
|
||||
"n",
|
||||
"<leader>#",
|
||||
":w<CR>:!chmod +x %:p<CR>ggi#!/bin/sh<CR><CR><Esc>:setfiletype bash<CR>",
|
||||
opts("setup sh script")
|
||||
)
|
||||
keymap.set(
|
||||
"n",
|
||||
"<leader><leader>#",
|
||||
":set syntax=python<CR>:w<CR>:!chmod +x %:p<CR>:LspStart pyright<CR>i#!/usr/bin/env python3<CR><CR>",
|
||||
opts("setup python script")
|
||||
)
|
||||
|
||||
-- select all
|
||||
keymap.set("n", "<leader>a", "ggVG", opts("select all"))
|
||||
@ -103,8 +111,23 @@ keymap.set("i", "<C-e>", "<C-Right>", opts("Jump back by word"))
|
||||
keymap.set("i", "<C-$>", "<End>", opts("Jump to EOL"))
|
||||
keymap.set("i", "<C-0>", "<Home>", opts("Jump to beginning of line"))
|
||||
|
||||
-- open in neovide
|
||||
-- keymap.set("n", "<leader>n", ":!neovide --no-fork %:p<CR>", opts("open in neovide (wip)"))
|
||||
-- Spell checking
|
||||
function StopTextlsp()
|
||||
local clients = vim.lsp.get_clients()
|
||||
for client in clients do
|
||||
if client.name == "textlsp" then
|
||||
vim.lsp.stop_client(client.id)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
keymap.set("n", "<leader>sr", ':lua vim.lsp.enable("textlsp")<CR>', opts("Start textlsp"))
|
||||
keymap.set("n", "<leader>sq", StopTextlsp, opts("Stop textlsp"))
|
||||
keymap.set("n", "<leader>ss", ":set spell<CR>", opts("Start built-in spell checker"))
|
||||
keymap.set("n", "<leader>sn", ":set nospell<CR>", opts("Stop spell checker"))
|
||||
keymap.set("n", "<leader>slu", ":set spelllang=en_us<CR>", opts("Set spell checker lang to en_US"))
|
||||
keymap.set("n", "<leader>sle", ":set spelllang=en_gb<CR>", opts("Set spell checker lang to en_GB"))
|
||||
keymap.set("n", "<leader>slc", ":set spelllang=de_ch<CR>", opts("Set spell checker lang to de_CH"))
|
||||
|
||||
-- deleting doesn't yank except when used with <leader>
|
||||
keymap.set({ "n", "v" }, "d", '"_d', opts())
|
||||
@ -127,4 +150,9 @@ keymap.set({ "n", "v" }, "<leader><leader>D", '"+D', opts("YANK to system clipbo
|
||||
keymap.set("n", "<leader>wk", ":WhichKey<CR>", opts("Toggle WhichKey"))
|
||||
|
||||
-- Toggle relative line numbers
|
||||
keymap.set( 'n', '<leader>.', ':lua vim.wo.relativenumber = not vim.wo.relativenumber', opts( 'Toggle relative line numbers' ))
|
||||
keymap.set(
|
||||
"n",
|
||||
"<leader>.",
|
||||
":lua vim.wo.relativenumber = not vim.wo.relativenumber",
|
||||
opts("Toggle relative line numbers")
|
||||
)
|
||||
|
@ -11,16 +11,15 @@ if not vim.loop.fs_stat(lazypath) then
|
||||
end
|
||||
vim.opt.rtp:prepend(lazypath)
|
||||
|
||||
|
||||
require("lazy").setup({
|
||||
spec = {
|
||||
{ import = "plugins.nav" },
|
||||
{ import = "plugins.lsp" },
|
||||
{ import = "plugins.style" },
|
||||
{ import = "plugins.util" },
|
||||
{ import = "plugins.testing" }
|
||||
{ import = "plugins.testing" },
|
||||
},
|
||||
change_detection = {
|
||||
notify = false, -- dont notify when plugins are changed
|
||||
}
|
||||
},
|
||||
})
|
||||
|
@ -16,8 +16,8 @@ vim.opt.breakindent = true
|
||||
vim.opt.linebreak = true
|
||||
|
||||
-- folding
|
||||
vim.wo.foldmethod = 'expr'
|
||||
vim.wo.foldexpr = 'v:lua.vim.treesitter.foldexpr()'
|
||||
vim.wo.foldmethod = "expr"
|
||||
vim.wo.foldexpr = "v:lua.vim.treesitter.foldexpr()"
|
||||
|
||||
-- line numbers
|
||||
vim.wo.number = true
|
||||
|
@ -86,7 +86,7 @@ return {
|
||||
-- Otherwise, fallback (insert a tab character)
|
||||
fallback()
|
||||
end
|
||||
end, { "i", "s" })
|
||||
end, { "i", "s" }),
|
||||
}),
|
||||
|
||||
-- sources for autocompletion
|
||||
@ -95,7 +95,7 @@ return {
|
||||
{ name = "luasnip" }, -- snippets
|
||||
{ name = "buffer" }, -- text within current buffer
|
||||
{ name = "path" }, -- file system paths
|
||||
{ name = 'nvim_lsp_signature_help' }, -- signature help
|
||||
{ name = "nvim_lsp_signature_help" }, -- signature help
|
||||
}),
|
||||
|
||||
formatting = {
|
||||
|
17
nvim/lua/plugins/lsp/ls/bashls.lua
Normal file
17
nvim/lua/plugins/lsp/ls/bashls.lua
Normal file
@ -0,0 +1,17 @@
|
||||
-- ┌ ┐
|
||||
-- │ Bash │
|
||||
-- └ ┘
|
||||
local lsp = vim.lsp
|
||||
|
||||
local capabilities = require("lsp-options").capabilities
|
||||
local on_attach = require("lsp-options").on_attach
|
||||
|
||||
lsp.config("bashls", {
|
||||
capabilities = capabilities,
|
||||
on_attach = on_attach,
|
||||
})
|
||||
|
||||
|
||||
-- ── Enable configs ───────────────────────────────────────────────
|
||||
local enable = vim.lsp.enable
|
||||
enable("bashls")
|
28
nvim/lua/plugins/lsp/ls/c.lua
Normal file
28
nvim/lua/plugins/lsp/ls/c.lua
Normal file
@ -0,0 +1,28 @@
|
||||
-- ┌ ┐
|
||||
-- │ C, Cpp, objc │
|
||||
-- └ ┘
|
||||
local lsp = vim.lsp
|
||||
|
||||
local capabilities = require("lsp-options").capabilities
|
||||
local on_attach = require("lsp-options").on_attach
|
||||
|
||||
lsp.config("clangd", {
|
||||
cmd = {
|
||||
"clangd",
|
||||
"--suggest-missing-includes",
|
||||
"--clang-tidy",
|
||||
},
|
||||
filetypes = { "c", "cpp", "objc", "objcpp", "cuda", "proto", "ino" },
|
||||
capabilities = capabilities,
|
||||
on_attach = on_attach,
|
||||
})
|
||||
|
||||
lsp.config("cmake", {
|
||||
capabilities = capabilities,
|
||||
on_attach = on_attach,
|
||||
})
|
||||
|
||||
-- ── Enable configs ───────────────────────────────────────────────
|
||||
local enable = vim.lsp.enable
|
||||
enable("clangd")
|
||||
enable("cmake")
|
17
nvim/lua/plugins/lsp/ls/go.lua
Normal file
17
nvim/lua/plugins/lsp/ls/go.lua
Normal file
@ -0,0 +1,17 @@
|
||||
-- ┌ ┐
|
||||
-- │ GO │
|
||||
-- └ ┘
|
||||
local lsp = vim.lsp
|
||||
|
||||
local capabilities = require("lsp-options").capabilities
|
||||
local on_attach = require("lsp-options").on_attach
|
||||
|
||||
lsp.config("gopls", {
|
||||
capabilities = capabilities,
|
||||
on_attach = on_attach,
|
||||
})
|
||||
|
||||
|
||||
-- ── Enable configs ───────────────────────────────────────────────
|
||||
local enable = vim.lsp.enable
|
||||
enable("gopls")
|
17
nvim/lua/plugins/lsp/ls/hypr.lua
Normal file
17
nvim/lua/plugins/lsp/ls/hypr.lua
Normal file
@ -0,0 +1,17 @@
|
||||
-- ┌ ┐
|
||||
-- │ Hyprland │
|
||||
-- └ ┘
|
||||
local lsp = vim.lsp
|
||||
|
||||
local capabilities = require("lsp-options").capabilities
|
||||
local on_attach = require("lsp-options").on_attach
|
||||
|
||||
lsp.config("hyprls", {
|
||||
capabilities = capabilities,
|
||||
on_attach = on_attach,
|
||||
})
|
||||
|
||||
|
||||
-- ── Enable configs ───────────────────────────────────────────────
|
||||
local enable = vim.lsp.enable
|
||||
enable("hyprls")
|
45
nvim/lua/plugins/lsp/ls/low-level.lua
Normal file
45
nvim/lua/plugins/lsp/ls/low-level.lua
Normal file
@ -0,0 +1,45 @@
|
||||
-- ┌ ┐
|
||||
-- │ Low-level (HDL and ASM) │
|
||||
-- └ ┘
|
||||
local lsp = vim.lsp
|
||||
|
||||
local capabilities = require("lsp-options").capabilities
|
||||
local on_attach = require("lsp-options").on_attach
|
||||
|
||||
-- ┌ ┐
|
||||
-- │ ASM │
|
||||
-- └ ┘
|
||||
lsp.config("asm_lsp", {
|
||||
on_attach = on_attach,
|
||||
capabilities = capabilities,
|
||||
})
|
||||
|
||||
-- ┌ ┐
|
||||
-- │ Verilog │
|
||||
-- └ ┘
|
||||
local lspconfutil = require("lspconfig/util")
|
||||
local root_pattern = lspconfutil.root_pattern("veridian.yml", ".git", ".xpr")
|
||||
local verilog_root_dir = function()
|
||||
local filename = lspconfutil.path.join(vim.loop.cwd(), fname)
|
||||
return root_pattern(filename) or lspconfutil.path.dirname(filename)
|
||||
end
|
||||
lsp.config("veridian", {
|
||||
capabilities = capabilities,
|
||||
on_attach = on_attach,
|
||||
root_dir = verilog_root_dir,
|
||||
})
|
||||
|
||||
lsp.config("verible", {
|
||||
-- cmd = { 'verible-verilog-ls', '--rules_config=/home/janis/.config/nvim/util/verible-conf.json' },
|
||||
cmd = { "verible-verilog-ls", "--rules=-no-trailing-spaces", "" },
|
||||
capabilities = capabilities,
|
||||
on_attach = on_attach,
|
||||
root_dir = verilog_root_dir,
|
||||
})
|
||||
|
||||
|
||||
-- ── Enable configs ───────────────────────────────────────────────
|
||||
local enable = vim.lsp.enable
|
||||
enable("veridian")
|
||||
enable("verible")
|
||||
enable("asm_lsp")
|
32
nvim/lua/plugins/lsp/ls/luals.lua
Normal file
32
nvim/lua/plugins/lsp/ls/luals.lua
Normal file
@ -0,0 +1,32 @@
|
||||
-- ┌ ┐
|
||||
-- │ LUA │
|
||||
-- └ ┘
|
||||
local lsp = vim.lsp
|
||||
|
||||
local capabilities = require("lsp-options").capabilities
|
||||
local on_attach = require("lsp-options").on_attach
|
||||
|
||||
lsp.config("lua_ls", {
|
||||
capabilities = capabilities,
|
||||
on_attach = on_attach,
|
||||
settings = {
|
||||
Lua = {
|
||||
-- make the language server recognize "vim" global
|
||||
diagnostics = {
|
||||
globals = { "vim" },
|
||||
},
|
||||
workspace = {
|
||||
-- make language server aware of runtime files
|
||||
library = {
|
||||
[vim.fn.expand("$VIMRUNTIME/lua")] = true,
|
||||
[vim.fn.stdpath("config") .. "/lua"] = true,
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
})
|
||||
|
||||
|
||||
-- ── Enable configs ───────────────────────────────────────────────
|
||||
local enable = vim.lsp.enable
|
||||
enable("lua_ls")
|
17
nvim/lua/plugins/lsp/ls/pyright.lua
Normal file
17
nvim/lua/plugins/lsp/ls/pyright.lua
Normal file
@ -0,0 +1,17 @@
|
||||
-- ┌ ┐
|
||||
-- │ Python │
|
||||
-- └ ┘
|
||||
local lsp = vim.lsp
|
||||
|
||||
local capabilities = require("lsp-options").capabilities
|
||||
local on_attach = require("lsp-options").on_attach
|
||||
|
||||
lsp.config("pyright", {
|
||||
capabilities = capabilities,
|
||||
on_attach = on_attach,
|
||||
})
|
||||
|
||||
|
||||
-- ── Enable configs ───────────────────────────────────────────────
|
||||
local enable = vim.lsp.enable
|
||||
enable("pyright")
|
17
nvim/lua/plugins/lsp/ls/ruby.lua
Normal file
17
nvim/lua/plugins/lsp/ls/ruby.lua
Normal file
@ -0,0 +1,17 @@
|
||||
-- ┌ ┐
|
||||
-- │ Ruby │
|
||||
-- └ ┘
|
||||
local lsp = vim.lsp
|
||||
|
||||
local capabilities = require("lsp-options").capabilities
|
||||
local on_attach = require("lsp-options").on_attach
|
||||
|
||||
lsp.config("ruby_lsp", {
|
||||
capabilities = capabilities,
|
||||
on_attach = on_attach,
|
||||
})
|
||||
|
||||
|
||||
-- ── Enable configs ───────────────────────────────────────────────
|
||||
local enable = vim.lsp.enable
|
||||
enable("ruby_lsp")
|
24
nvim/lua/plugins/lsp/ls/rust-analyzer.lua
Normal file
24
nvim/lua/plugins/lsp/ls/rust-analyzer.lua
Normal file
@ -0,0 +1,24 @@
|
||||
-- ┌ ┐
|
||||
-- │ Rust │
|
||||
-- └ ┘
|
||||
local lsp = vim.lsp
|
||||
|
||||
local capabilities = require("lsp-options").capabilities
|
||||
local on_attach = require("lsp-options").on_attach
|
||||
|
||||
lsp.config("rust_analyzer", {
|
||||
settings = {
|
||||
["rust-analyzer"] = {
|
||||
diagnostics = {
|
||||
enable = true,
|
||||
},
|
||||
},
|
||||
},
|
||||
capabilities = capabilities,
|
||||
on_attach = on_attach,
|
||||
})
|
||||
|
||||
|
||||
-- ── Enable configs ───────────────────────────────────────────────
|
||||
local enable = vim.lsp.enable
|
||||
enable("rust_analyzer")
|
36
nvim/lua/plugins/lsp/ls/text.lua
Normal file
36
nvim/lua/plugins/lsp/ls/text.lua
Normal file
@ -0,0 +1,36 @@
|
||||
-- ┌ ┐
|
||||
-- │ Text languages (TeX and MD) │
|
||||
-- └ ┘
|
||||
local lsp = vim.lsp
|
||||
|
||||
local capabilities = require("lsp-options").capabilities
|
||||
local on_attach = require("lsp-options").on_attach
|
||||
|
||||
-- ┌ ┐
|
||||
-- │ Markdown │
|
||||
-- └ ┘
|
||||
lsp.config("marksman", {
|
||||
capabilities = capabilities,
|
||||
on_attach = on_attach,
|
||||
})
|
||||
|
||||
-- ┌ ┐
|
||||
-- │ LaTeX │
|
||||
-- └ ┘
|
||||
lsp.config("texlab", {
|
||||
capabilities = capabilities,
|
||||
on_attach = on_attach,
|
||||
})
|
||||
|
||||
-- ┌ ┐
|
||||
-- │ Spell checking │
|
||||
-- └ ┘
|
||||
lsp.config("textlsp", {
|
||||
capabilities = capabilities,
|
||||
on_attach = on_attach,
|
||||
})
|
||||
|
||||
-- ── Enable configs ───────────────────────────────────────────────
|
||||
local enable = vim.lsp.enable
|
||||
enable("marksman")
|
||||
enable("texlab")
|
69
nvim/lua/plugins/lsp/ls/web.lua
Normal file
69
nvim/lua/plugins/lsp/ls/web.lua
Normal file
@ -0,0 +1,69 @@
|
||||
-- ┌ ┐
|
||||
-- │ Web technology │
|
||||
-- └ ┘
|
||||
local lsp = vim.lsp
|
||||
|
||||
local capabilities = require("lsp-options").capabilities
|
||||
local on_attach = require("lsp-options").on_attach
|
||||
|
||||
-- ┌ ┐
|
||||
-- │ HTML, CSS, JSON │
|
||||
-- └ ┘
|
||||
lsp.config("cssls", {
|
||||
capabilities = capabilities,
|
||||
on_attach = on_attach,
|
||||
})
|
||||
|
||||
lsp.config("html", {
|
||||
capabilities = capabilities,
|
||||
on_attach = on_attach,
|
||||
})
|
||||
|
||||
lsp.config("jsonls", {
|
||||
capabilities = capabilities,
|
||||
on_attach = on_attach,
|
||||
})
|
||||
|
||||
-- ┌ ┐
|
||||
-- │ Vue │
|
||||
-- └ ┘
|
||||
lsp.config("vue_ls", {
|
||||
capabilities = capabilities,
|
||||
on_attach = on_attach,
|
||||
filetypes = {
|
||||
"vue",
|
||||
},
|
||||
})
|
||||
|
||||
-- ┌ ┐
|
||||
-- │ TS, JS, TSX, JSX │
|
||||
-- └ ┘
|
||||
lsp.config("ts_ls", {
|
||||
capabilities = capabilities,
|
||||
on_attach = on_attach,
|
||||
init_options = {
|
||||
plugins = {
|
||||
{
|
||||
name = "@vue/typescript-plugin",
|
||||
location = "/usr/lib/node_modules/@vue/typescript-plugin",
|
||||
languages = { "javascript", "typescript", "vue" },
|
||||
},
|
||||
},
|
||||
},
|
||||
filetypes = {
|
||||
"javascript",
|
||||
"typescript",
|
||||
"typescriptreact",
|
||||
"javascriptreact",
|
||||
"vue",
|
||||
},
|
||||
})
|
||||
|
||||
|
||||
-- ── Enable configs ───────────────────────────────────────────────
|
||||
local enable = vim.lsp.enable
|
||||
enable("jsonls")
|
||||
enable("html")
|
||||
enable("css")
|
||||
enable("vue_ls")
|
||||
enable("ts_ls")
|
@ -1,3 +1,7 @@
|
||||
-- ───────────────────────────────────────────────────────────────────
|
||||
-- ╭───────────────────────────────────────────────╮
|
||||
-- │ LSP Configuration │
|
||||
-- ╰───────────────────────────────────────────────╯
|
||||
return {
|
||||
-- lsp configuration
|
||||
"neovim/nvim-lspconfig",
|
||||
@ -8,12 +12,8 @@ return {
|
||||
"mfussenegger/nvim-jdtls",
|
||||
},
|
||||
config = function()
|
||||
local lsp = vim.lsp
|
||||
local enable = vim.lsp.enable
|
||||
|
||||
local capabilities = require("lsp-options").capabilities
|
||||
local on_attach = require("lsp-options").on_attach
|
||||
|
||||
-- Change the Diagnostic symbols in the sign column (gutter)
|
||||
local signs = { Error = " ", Warn = " ", Hint = "", Info = " " }
|
||||
for type, icon in pairs(signs) do
|
||||
@ -21,189 +21,22 @@ return {
|
||||
vim.fn.sign_define(hl, { text = icon, texthl = hl, numhl = "" })
|
||||
end
|
||||
|
||||
-- ┌ ┐
|
||||
-- │ Bash │
|
||||
-- └ ┘
|
||||
lsp.config("bashls", {
|
||||
capabilities = capabilities,
|
||||
on_attach = on_attach,
|
||||
})
|
||||
|
||||
-- ┌ ┐
|
||||
-- │ C, Cpp, objc │
|
||||
-- └ ┘
|
||||
lsp.config("clangd", {
|
||||
cmd = {
|
||||
"clangd",
|
||||
"--suggest-missing-includes",
|
||||
"--clang-tidy",
|
||||
},
|
||||
filetypes = { "c", "cpp", "objc", "objcpp", "cuda", "proto", "ino" },
|
||||
capabilities = capabilities,
|
||||
on_attach = on_attach,
|
||||
})
|
||||
|
||||
-- ┌ ┐
|
||||
-- │ Rust │
|
||||
-- └ ┘
|
||||
lsp.config("rust_analyzer", {
|
||||
settings = {
|
||||
["rust-analyzer"] = {
|
||||
diagnostics = {
|
||||
enable = true,
|
||||
},
|
||||
},
|
||||
},
|
||||
capabilities = capabilities,
|
||||
on_attach = on_attach,
|
||||
})
|
||||
|
||||
-- ┌ ┐
|
||||
-- │ HTML, CSS, JSON │
|
||||
-- └ ┘
|
||||
lsp.config("cssls", {
|
||||
capabilities = capabilities,
|
||||
on_attach = on_attach,
|
||||
})
|
||||
|
||||
lsp.config("html", {
|
||||
capabilities = capabilities,
|
||||
on_attach = on_attach,
|
||||
})
|
||||
|
||||
lsp.config("jsonls", {
|
||||
capabilities = capabilities,
|
||||
on_attach = on_attach,
|
||||
})
|
||||
|
||||
-- ┌ ┐
|
||||
-- │ LUA │
|
||||
-- └ ┘
|
||||
lsp.config("lua_ls", {
|
||||
capabilities = capabilities,
|
||||
on_attach = on_attach,
|
||||
settings = {
|
||||
Lua = {
|
||||
-- make the language server recognize "vim" global
|
||||
diagnostics = {
|
||||
globals = { "vim" },
|
||||
},
|
||||
workspace = {
|
||||
-- make language server aware of runtime files
|
||||
library = {
|
||||
[vim.fn.expand("$VIMRUNTIME/lua")] = true,
|
||||
[vim.fn.stdpath("config") .. "/lua"] = true,
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
})
|
||||
|
||||
-- ┌ ┐
|
||||
-- │ Markdown │
|
||||
-- └ ┘
|
||||
lsp.config("marksman", {
|
||||
capabilities = capabilities,
|
||||
on_attach = on_attach,
|
||||
})
|
||||
|
||||
-- ┌ ┐
|
||||
-- │ Python │
|
||||
-- └ ┘
|
||||
lsp.config("pyright", {
|
||||
capabilities = capabilities,
|
||||
on_attach = on_attach,
|
||||
})
|
||||
|
||||
-- ┌ ┐
|
||||
-- │ Vue │
|
||||
-- └ ┘
|
||||
lsp.config("vue_ls", {
|
||||
capabilities = capabilities,
|
||||
on_attach = on_attach,
|
||||
filetypes = {
|
||||
"vue",
|
||||
},
|
||||
})
|
||||
|
||||
-- ┌ ┐
|
||||
-- │ TS, JS, TSX, JSX │
|
||||
-- └ ┘
|
||||
lsp.config("ts_ls", {
|
||||
capabilities = capabilities,
|
||||
on_attach = on_attach,
|
||||
init_options = {
|
||||
plugins = {
|
||||
{
|
||||
name = "@vue/typescript-plugin",
|
||||
location = "/usr/lib/node_modules/@vue/typescript-plugin",
|
||||
languages = { "javascript", "typescript", "vue" },
|
||||
},
|
||||
},
|
||||
},
|
||||
filetypes = {
|
||||
"javascript",
|
||||
"typescript",
|
||||
"typescriptreact",
|
||||
"javascriptreact",
|
||||
"vue",
|
||||
},
|
||||
})
|
||||
|
||||
-- ┌ ┐
|
||||
-- │ ASM │
|
||||
-- └ ┘
|
||||
lsp.config("asm_lsp", {
|
||||
on_attach = on_attach,
|
||||
capabilities = capabilities,
|
||||
})
|
||||
|
||||
-- ┌ ┐
|
||||
-- │ LaTeX │
|
||||
-- └ ┘
|
||||
lsp.config("texlab", {
|
||||
capabilities = capabilities,
|
||||
on_attach = on_attach,
|
||||
})
|
||||
|
||||
-- ┌ ┐
|
||||
-- │ Verilog │
|
||||
-- └ ┘
|
||||
local lspconfutil = require("lspconfig/util")
|
||||
local root_pattern = lspconfutil.root_pattern("veridian.yml", ".git", ".xpr")
|
||||
local verilog_root_dir = function()
|
||||
local filename = lspconfutil.path.join(vim.loop.cwd(), fname)
|
||||
return root_pattern(filename) or lspconfutil.path.dirname(filename)
|
||||
end
|
||||
lsp.config("veridian", {
|
||||
capabilities = capabilities,
|
||||
on_attach = on_attach,
|
||||
root_dir = verilog_root_dir,
|
||||
})
|
||||
|
||||
lsp.config("verible", {
|
||||
-- cmd = { 'verible-verilog-ls', '--rules_config=/home/janis/.config/nvim/util/verible-conf.json' },
|
||||
cmd = { "verible-verilog-ls", "--rules=-no-trailing-spaces", "" },
|
||||
capabilities = capabilities,
|
||||
on_attach = on_attach,
|
||||
root_dir = verilog_root_dir,
|
||||
})
|
||||
|
||||
-- ───────────────────────────────────────────────────────────────────
|
||||
-- ╭───────────────────────────────────────────────╮
|
||||
-- │ Enable the configs │
|
||||
-- │ Import configs from other files │
|
||||
-- ╰───────────────────────────────────────────────╯
|
||||
enable("bashls")
|
||||
enable("clangd")
|
||||
enable("rust_analyzer")
|
||||
enable("marksman")
|
||||
enable("vue_ls")
|
||||
enable("ts_ls")
|
||||
enable("texlab")
|
||||
enable("asm_lsp")
|
||||
enable("jsonls")
|
||||
enable("cssls")
|
||||
enable("html")
|
||||
enable("lua_ls")
|
||||
enable("pyright")
|
||||
require("plugins.lsp.ls.bashls")
|
||||
require("plugins.lsp.ls.c")
|
||||
require("plugins.lsp.ls.go")
|
||||
require("plugins.lsp.ls.hypr")
|
||||
require("plugins.lsp.ls.low-level")
|
||||
require("plugins.lsp.ls.luals")
|
||||
require("plugins.lsp.ls.pyright")
|
||||
require("plugins.lsp.ls.rust-analyzer")
|
||||
require("plugins.lsp.ls.ruby")
|
||||
require("plugins.lsp.ls.text")
|
||||
require("plugins.lsp.ls.web")
|
||||
-- ───────────────────────────────────────────────────────────────────
|
||||
end,
|
||||
}
|
||||
-- ───────────────────────────────────────────────────────────────────
|
||||
|
@ -1,12 +1,3 @@
|
||||
return {
|
||||
'L3MON4D3/LuaSnip',
|
||||
-- config = function()
|
||||
-- local luasnip = require('luasnip')
|
||||
-- -- luasnip.setup({
|
||||
-- -- region_check_events = "CursorMoved",
|
||||
-- -- delete_check_events = "TextChanged",
|
||||
-- -- })
|
||||
--
|
||||
-- require("luasnip.loaders.from_vscode").load({paths = "~/.config/nvim/my_snippets"})
|
||||
-- end
|
||||
"L3MON4D3/LuaSnip",
|
||||
}
|
||||
|
@ -26,15 +26,21 @@ return {
|
||||
-- list of servers for mason to install
|
||||
ensure_installed = {
|
||||
"asm-lsp",
|
||||
-- "bashls",
|
||||
-- "clangd",
|
||||
"bashls",
|
||||
"clangd",
|
||||
"cmake",
|
||||
-- "cssls",
|
||||
"dartls",
|
||||
"gopls",
|
||||
"hyprls",
|
||||
"jdtls",
|
||||
"marksman",
|
||||
-- "lua_ls",
|
||||
-- "pyright",
|
||||
"rust_analyzer",
|
||||
-- "tsserver",
|
||||
"ruby_lsp",
|
||||
-- "ts_ls",
|
||||
"textlsp",
|
||||
"vue_ls"
|
||||
},
|
||||
-- auto-install configured servers (with lspconfig)
|
||||
|
@ -1,7 +1,10 @@
|
||||
-- ┌ ┐
|
||||
-- │ Formatting, diagnostics │
|
||||
-- └ ┘
|
||||
return {
|
||||
"nvimtools/none-ls.nvim",
|
||||
dependencies = {
|
||||
'nvimtools/none-ls-extras.nvim'
|
||||
"nvimtools/none-ls-extras.nvim",
|
||||
},
|
||||
config = function()
|
||||
local null_ls = require("null-ls")
|
||||
@ -46,9 +49,9 @@ return {
|
||||
null_ls.builtins.formatting.shfmt,
|
||||
null_ls.builtins.formatting.asmfmt,
|
||||
null_ls.builtins.code_actions.proselint,
|
||||
require( 'none-ls.diagnostics.eslint_d' ),
|
||||
require( 'none-ls.code_actions.eslint_d' ),
|
||||
require( 'none-ls.formatting.eslint_d' ),
|
||||
require("none-ls.diagnostics.eslint_d"),
|
||||
require("none-ls.code_actions.eslint_d"),
|
||||
require("none-ls.formatting.eslint_d"),
|
||||
null_ls.builtins.formatting.black,
|
||||
},
|
||||
})
|
||||
|
@ -41,13 +41,13 @@ return {
|
||||
"vue",
|
||||
"xml",
|
||||
"yaml",
|
||||
"zathurarc"
|
||||
"zathurarc",
|
||||
},
|
||||
sync_install = false,
|
||||
|
||||
highlight = {
|
||||
enable = true,
|
||||
disable = { "tex" }
|
||||
disable = { "tex" },
|
||||
},
|
||||
})
|
||||
end,
|
||||
|
@ -2,14 +2,14 @@ return {
|
||||
"lervag/vimtex",
|
||||
config = function()
|
||||
-- vimtex settings
|
||||
-- vim.g.vimtex_view_method = 'startup' -- PDF viewer (example: zathura, or use 'skim' for macOS)
|
||||
vim.g.vimtex_compiler_method = 'latexmk' -- Use latexmk for compilation
|
||||
-- vim.g.vimtex_view_method = 'zathura' -- PDF viewer (example: zathura, or use 'skim' for macOS)
|
||||
vim.g.vimtex_compiler_method = "latexmk" -- Use latexmk for compilation
|
||||
vim.g.vimtex_fold_enabled = 1 -- Enable folding for LaTeX sections
|
||||
vim.g.vimtex_quickfix_mode = 0 -- Disable quickfix mode for compilation errors
|
||||
-- Key Mappings for LaTeX workflow
|
||||
vim.api.nvim_set_keymap('n', '<leader>lc', ':VimtexCompile<CR>', {}) -- Compile LaTeX file
|
||||
vim.api.nvim_set_keymap('n', '<leader>lv', ':VimtexView<CR>', {}) -- View compiled PDF
|
||||
vim.api.nvim_set_keymap('n', '<leader>lq', ':VimtexStop<CR>', {}) -- Stop compilation
|
||||
|
||||
end
|
||||
-- ── Key Mappings for LaTeX workflow ──────────────────────────────
|
||||
vim.api.nvim_set_keymap("n", "<leader>lc", ":VimtexCompile<CR>", {}) -- Compile LaTeX file
|
||||
vim.api.nvim_set_keymap("n", "<leader>lv", ":VimtexView<CR>", {}) -- View compiled PDF
|
||||
vim.api.nvim_set_keymap("n", "<leader>lq", ":VimtexStop<CR>", {}) -- Stop compilation
|
||||
end,
|
||||
}
|
||||
|
@ -1,7 +1,12 @@
|
||||
return {
|
||||
"echasnovski/mini.bufremove",
|
||||
config = function()
|
||||
_G.MiniBufremove = require( 'mini.bufremove' );
|
||||
vim.keymap.set( 'n', '<C-x>', ':lua MiniBufremove.delete()<CR>', { silent = true, noremap = true, desc = 'Remove buffer' } );
|
||||
_G.MiniBufremove = require("mini.bufremove")
|
||||
vim.keymap.set(
|
||||
"n",
|
||||
"<C-x>",
|
||||
":lua MiniBufremove.delete()<CR>",
|
||||
{ silent = true, noremap = true, desc = "Remove buffer" }
|
||||
)
|
||||
end,
|
||||
}
|
||||
|
@ -1,7 +1,7 @@
|
||||
return {
|
||||
-- open file at previous position
|
||||
'ethanholz/nvim-lastplace',
|
||||
"ethanholz/nvim-lastplace",
|
||||
config = function()
|
||||
require('nvim-lastplace').setup{}
|
||||
require("nvim-lastplace").setup({})
|
||||
end,
|
||||
}
|
||||
|
@ -141,6 +141,6 @@ return {
|
||||
custom_hl_group = nil, -- "Visual" or any other hl group to use instead of inverted colors
|
||||
})
|
||||
|
||||
vim.keymap.set("n", "<leader>n", ":Navbuddy<CR>", { silent = true, desc = "open navbuddy menu" })
|
||||
vim.keymap.set("n", "<leader><leader>n", ":Navbuddy<CR>", { silent = true, desc = "open navbuddy menu" })
|
||||
end,
|
||||
}
|
||||
|
@ -174,7 +174,7 @@ return {
|
||||
},
|
||||
nesting_rules = {},
|
||||
filesystem = {
|
||||
scan_mode = 'deep',
|
||||
scan_mode = "deep",
|
||||
filtered_items = {
|
||||
visible = false, -- when true, they will just be displayed differently than normal items
|
||||
hide_dotfiles = true,
|
||||
|
@ -35,34 +35,34 @@ return {
|
||||
|
||||
-- Recent Commands
|
||||
opts.desc = "Show recent commands"
|
||||
vim.keymap.set('n', '<leader>frc', ':Telescope command_history<CR>', opts)
|
||||
vim.keymap.set("n", "<leader>frc", ":Telescope command_history<CR>", opts)
|
||||
|
||||
-- Recent Searches
|
||||
opts.desc = "Show recent searches"
|
||||
vim.keymap.set('n', '<leader>frs', ':Telescope search_history<CR>', opts)
|
||||
vim.keymap.set("n", "<leader>frs", ":Telescope search_history<CR>", opts)
|
||||
|
||||
-- Old Files
|
||||
opts.desc = "Show recent files"
|
||||
vim.keymap.set('n', '<leader>frf', ':Telescope oldfiles<CR>', opts)
|
||||
vim.keymap.set("n", "<leader>frf", ":Telescope oldfiles<CR>", opts)
|
||||
|
||||
-- Quickfix Items
|
||||
opts.desc = "Show quickfix items"
|
||||
vim.keymap.set('n', '<leader>fq', ':Telescope quickfix<CR>', opts)
|
||||
vim.keymap.set("n", "<leader>fq", ":Telescope quickfix<CR>", opts)
|
||||
|
||||
-- Spell Suggestions
|
||||
opts.desc = "Show spell suggestions"
|
||||
vim.keymap.set('n', '<leader>fs', ':Telescope spell_suggest<CR>', opts)
|
||||
vim.keymap.set("n", "<leader>fs", ":Telescope spell_suggest<CR>", opts)
|
||||
|
||||
-- Diagnostics
|
||||
opts.desc = "Show diagnostics"
|
||||
vim.keymap.set('n', '<leader>fd', ':Telescope diagnostics<CR>', opts)
|
||||
vim.keymap.set("n", "<leader>fd", ":Telescope diagnostics<CR>", opts)
|
||||
|
||||
-- Notifications
|
||||
opts.desc = "Show notifications"
|
||||
vim.keymap.set('n', '<leader>fn', ':Telescope notify<CR>', opts)
|
||||
vim.keymap.set("n", "<leader>fn", ":Telescope notify<CR>", opts)
|
||||
|
||||
-- Implementations
|
||||
opts.desc = "Show implementations"
|
||||
vim.keymap.set('n', '<leader>fi', ':Telescope lsp_implementations<CR>', opts)
|
||||
vim.keymap.set("n", "<leader>fi", ":Telescope lsp_implementations<CR>", opts)
|
||||
end,
|
||||
}
|
||||
|
@ -6,7 +6,5 @@ return {
|
||||
vim.o.timeout = true
|
||||
vim.o.timeoutlen = 500
|
||||
end,
|
||||
opts = {
|
||||
|
||||
}
|
||||
opts = {},
|
||||
}
|
||||
|
@ -1,9 +1,9 @@
|
||||
return {
|
||||
-- colorizes colors in code
|
||||
'NvChad/nvim-colorizer.lua' ,
|
||||
"NvChad/nvim-colorizer.lua",
|
||||
--cmd = 'ColorizerToggle',
|
||||
config = function()
|
||||
require("colorizer").setup {
|
||||
require("colorizer").setup({
|
||||
filetypes = { "*" },
|
||||
user_default_options = {
|
||||
RGB = true, -- #RGB hex codes - #FCE
|
||||
@ -21,14 +21,14 @@ return {
|
||||
-- True is same as normal
|
||||
tailwind = false, -- Enable tailwind colors
|
||||
-- parsers can contain values used in |user_default_options|
|
||||
sass = { enable = false, parsers = { "css" }, }, -- Enable sass colors
|
||||
sass = { enable = false, parsers = { "css" } }, -- Enable sass colors
|
||||
virtualtext = "■",
|
||||
-- update color values even if buffer is not focused
|
||||
-- example use: cmp_menu, cmp_docs
|
||||
always_update = false
|
||||
always_update = false,
|
||||
},
|
||||
-- all the sub-options of filetypes apply to buftypes
|
||||
buftypes = {},
|
||||
}
|
||||
})
|
||||
end,
|
||||
}
|
||||
|
@ -13,7 +13,7 @@ return {
|
||||
functions = "italic",
|
||||
keywords = "italic",
|
||||
types = "italic",
|
||||
}
|
||||
},
|
||||
},
|
||||
palettes = {
|
||||
all = {
|
||||
@ -77,7 +77,7 @@ return {
|
||||
statement = "magenta",
|
||||
string = "cyan",
|
||||
type = "red",
|
||||
variable = "orange"
|
||||
variable = "orange",
|
||||
},
|
||||
diag = {
|
||||
error = "darkred",
|
||||
@ -91,22 +91,22 @@ return {
|
||||
warn = "#a16b00",
|
||||
info = "cyan",
|
||||
hint = "bg3",
|
||||
ok = "green";
|
||||
ok = "green",
|
||||
},
|
||||
diff = {
|
||||
add = "darkgreen",
|
||||
delete = "darkred",
|
||||
changed = "lightblue",
|
||||
text = "fg0"
|
||||
text = "fg0",
|
||||
},
|
||||
git = {
|
||||
add = "darkgreen",
|
||||
removed = "darkred",
|
||||
changed = "lightblue",
|
||||
conflict = "orange",
|
||||
ignored = "gray"
|
||||
}
|
||||
}
|
||||
ignored = "gray",
|
||||
},
|
||||
},
|
||||
},
|
||||
groups = {
|
||||
all = {
|
||||
|
@ -1,10 +1,10 @@
|
||||
return {
|
||||
-- add comment keybinds
|
||||
'numToStr/Comment.nvim',
|
||||
"numToStr/Comment.nvim",
|
||||
opts = {},
|
||||
lazy = false,
|
||||
config = function()
|
||||
require('Comment').setup()
|
||||
require('Comment.ft').set('hyprlang', '#%s')
|
||||
end
|
||||
require("Comment").setup()
|
||||
require("Comment.ft").set("hyprlang", "#%s")
|
||||
end,
|
||||
}
|
||||
|
@ -1,5 +1,5 @@
|
||||
return {
|
||||
-- prettier prompts
|
||||
'stevearc/dressing.nvim',
|
||||
event = 'VeryLazy',
|
||||
"stevearc/dressing.nvim",
|
||||
event = "VeryLazy",
|
||||
}
|
||||
|
@ -1,7 +1,7 @@
|
||||
return {
|
||||
-- status line
|
||||
'nvim-lualine/lualine.nvim',
|
||||
dependencies = { 'nvim-tree/nvim-web-devicons' },
|
||||
"nvim-lualine/lualine.nvim",
|
||||
dependencies = { "nvim-tree/nvim-web-devicons" },
|
||||
config = function()
|
||||
local function getWords()
|
||||
local wc = vim.api.nvim_eval("wordcount()")
|
||||
@ -11,45 +11,45 @@ return {
|
||||
return wc["words"]
|
||||
end
|
||||
end
|
||||
require('lualine').setup {
|
||||
require("lualine").setup({
|
||||
options = {
|
||||
icons_enabled = true,
|
||||
theme = "auto",
|
||||
component_separators = { left = '', right = ''},
|
||||
section_separators = { left = '', right = ''},
|
||||
component_separators = { left = "", right = "" },
|
||||
section_separators = { left = "", right = "" },
|
||||
disabled_filetypes = {
|
||||
statusline = {},
|
||||
winbar = {},
|
||||
},
|
||||
ignore_focus = { 'neo-tree' },
|
||||
ignore_focus = { "neo-tree" },
|
||||
always_divide_middle = true,
|
||||
globalstatus = false,
|
||||
refresh = {
|
||||
statusline = 1000,
|
||||
tabline = 1000,
|
||||
winbar = 1000,
|
||||
}
|
||||
},
|
||||
},
|
||||
sections = {
|
||||
lualine_a = { { 'mode', separator = { left = '', right = '' }, } },
|
||||
lualine_b = {'branch', 'diff', 'diagnostics'},
|
||||
lualine_c = {'filename'},
|
||||
lualine_x = { getWords, 'encoding', 'fileformat', 'filetype'},
|
||||
lualine_y = { { 'progress', left_padding=0 } },
|
||||
lualine_z = { { 'location', separator = { left = '', right = '' }, padding=0} }
|
||||
lualine_a = { { "mode", separator = { left = "", right = "" } } },
|
||||
lualine_b = { "branch", "diff", "diagnostics" },
|
||||
lualine_c = { "filename" },
|
||||
lualine_x = { getWords, "encoding", "fileformat", "filetype" },
|
||||
lualine_y = { { "progress", left_padding = 0 } },
|
||||
lualine_z = { { "location", separator = { left = "", right = "" }, padding = 0 } },
|
||||
},
|
||||
inactive_sections = {
|
||||
lualine_a = {},
|
||||
lualine_b = {},
|
||||
lualine_c = {'filename'},
|
||||
lualine_x = {'location'},
|
||||
lualine_c = { "filename" },
|
||||
lualine_x = { "location" },
|
||||
lualine_y = {},
|
||||
lualine_z = {}
|
||||
lualine_z = {},
|
||||
},
|
||||
tabline = {},
|
||||
winbar = {},
|
||||
inactive_winbar = {},
|
||||
extensions = {}
|
||||
}
|
||||
extensions = {},
|
||||
})
|
||||
end,
|
||||
}
|
||||
|
@ -10,12 +10,12 @@ return {
|
||||
"rcarriga/nvim-notify",
|
||||
},
|
||||
config = function()
|
||||
require( 'notify' ).setup( {
|
||||
require("notify").setup({
|
||||
max_width = 80,
|
||||
minimum_width = 30,
|
||||
render = 'wrapped-default', -- default, minimal, simple, compact, wrapped-compact or wrapped-default
|
||||
stages = 'slide', -- fade_in_slide_out, fade, slide, static
|
||||
} );
|
||||
render = "wrapped-default", -- default, minimal, simple, compact, wrapped-compact or wrapped-default
|
||||
stages = "slide", -- fade_in_slide_out, fade, slide, static
|
||||
})
|
||||
require("noice").setup({
|
||||
lsp = {
|
||||
-- override markdown rendering so that **cmp** and other plugins use **Treesitter**
|
||||
|
@ -26,7 +26,7 @@ return {
|
||||
[[ ]],
|
||||
},
|
||||
highlight = "String",
|
||||
default_color = "#010155"
|
||||
default_color = "#010155",
|
||||
},
|
||||
|
||||
quotes = {
|
||||
@ -43,7 +43,7 @@ return {
|
||||
end
|
||||
end,
|
||||
highlight = "String",
|
||||
default_color = "#FFFFFF"
|
||||
default_color = "#FFFFFF",
|
||||
},
|
||||
|
||||
old = {
|
||||
@ -58,12 +58,12 @@ return {
|
||||
},
|
||||
|
||||
options = {
|
||||
mapping_keys = false;
|
||||
mapping_keys = false,
|
||||
},
|
||||
|
||||
colors = {
|
||||
background = "#000000",
|
||||
folded_section = "#100000"
|
||||
folded_section = "#100000",
|
||||
},
|
||||
|
||||
mappings = {
|
||||
@ -71,7 +71,7 @@ return {
|
||||
open_file = "<CR>",
|
||||
},
|
||||
|
||||
parts = {"title", "quotes", "old"}
|
||||
parts = { "title", "quotes", "old" },
|
||||
})
|
||||
end,
|
||||
}
|
||||
|
@ -48,9 +48,15 @@ return {
|
||||
end
|
||||
|
||||
vim.fn.sign_define("DapBreakpoint", { text = "●", texthl = "DapBreakpoint", linehl = "", numhl = "" })
|
||||
vim.fn.sign_define("DapBreakpointCondition", { text = "●", texthl = "DapBreakpointCondition", linehl = "", numhl = ""})
|
||||
vim.fn.sign_define(
|
||||
"DapBreakpointCondition",
|
||||
{ text = "●", texthl = "DapBreakpointCondition", linehl = "", numhl = "" }
|
||||
)
|
||||
vim.fn.sign_define("DapLogPoint", { text = "◆", texthl = "DapLogPoint", linehl = "", numhl = "" })
|
||||
vim.fn.sign_define('DapStopped', { text='', texthl='DapStopped', linehl='DapStopped', numhl= 'DapStopped' })
|
||||
vim.fn.sign_define(
|
||||
"DapStopped",
|
||||
{ text = "", texthl = "DapStopped", linehl = "DapStopped", numhl = "DapStopped" }
|
||||
)
|
||||
|
||||
dap.configurations.python = {
|
||||
{
|
||||
@ -91,7 +97,7 @@ return {
|
||||
else
|
||||
cb({
|
||||
type = "executable",
|
||||
command = vim.fn.stdpath("data") .. '/mason/packages/debugpy/venv/bin/python',
|
||||
command = vim.fn.stdpath("data") .. "/mason/packages/debugpy/venv/bin/python",
|
||||
args = { "-m", "debugpy.adapter" },
|
||||
options = {
|
||||
source_filetype = "python",
|
||||
|
@ -1,13 +1,13 @@
|
||||
return {
|
||||
"windwp/nvim-ts-autotag",
|
||||
config = function()
|
||||
require('nvim-ts-autotag').setup({
|
||||
require("nvim-ts-autotag").setup({
|
||||
opts = {
|
||||
-- Defaults
|
||||
enable_close = true, -- Auto close tags
|
||||
enable_rename = true, -- Auto rename pairs of tags
|
||||
enable_close_on_slash = true -- Auto close on trailing </
|
||||
enable_close_on_slash = true, -- Auto close on trailing </
|
||||
},
|
||||
})
|
||||
end
|
||||
end,
|
||||
}
|
||||
|
@ -1,16 +1,21 @@
|
||||
return {
|
||||
'uga-rosa/ccc.nvim',
|
||||
"uga-rosa/ccc.nvim",
|
||||
config = function()
|
||||
local ccc = require( 'ccc' );
|
||||
vim.opt.termguicolors = true;
|
||||
local ccc = require("ccc")
|
||||
vim.opt.termguicolors = true
|
||||
ccc.setup({
|
||||
highlighter = {
|
||||
auto_enable = false,
|
||||
lsp = true
|
||||
}
|
||||
lsp = true,
|
||||
},
|
||||
})
|
||||
|
||||
local keymap = vim.keymap
|
||||
keymap.set( 'n', '<leader>cp', '<cmd>CccPick<CR>', { noremap = true, silent = true, desc = "Toggle colour picker" } )
|
||||
end
|
||||
keymap.set(
|
||||
"n",
|
||||
"<leader>cp",
|
||||
"<cmd>CccPick<CR>",
|
||||
{ noremap = true, silent = true, desc = "Toggle colour picker" }
|
||||
)
|
||||
end,
|
||||
}
|
||||
|
@ -6,9 +6,8 @@ return {
|
||||
notification = {
|
||||
window = {
|
||||
winblend = 0,
|
||||
}
|
||||
}
|
||||
},
|
||||
},
|
||||
})
|
||||
end
|
||||
|
||||
end,
|
||||
}
|
||||
|
@ -1,15 +0,0 @@
|
||||
return {
|
||||
"kikofmas/grammarous.nvim",
|
||||
config = function ()
|
||||
local keymap = vim.keymap
|
||||
local opts = require('utils').opts
|
||||
|
||||
keymap.set('n', '<leader>sr', ':GrammarousCheck<CR>', opts('LanguageTool Spell Checker'))
|
||||
keymap.set('n', '<leader>sc', ':GrammarousCheck --comments-only<CR>', opts('LanguageTool Spell Checker, only comments'))
|
||||
keymap.set('n', '<leader>ss', ':set spell<CR>', opts('Start built-in spell checker'))
|
||||
keymap.set('n', '<leader>sn', ':set nospell<CR>', opts('Stop spell checker'))
|
||||
keymap.set('n', '<leader>slu', ':set spelllang=en_us<CR>', opts('Set spell checker lang to en_US'))
|
||||
keymap.set('n', '<leader>sle', ':set spelllang=en_gb<CR>', opts('Set spell checker lang to en_GB'))
|
||||
keymap.set('n', '<leader>slc', ':set spelllang=de_ch<CR>', opts('Set spell checker lang to de_CH'))
|
||||
end
|
||||
}
|
@ -1,9 +1,9 @@
|
||||
return {
|
||||
-- indent lines
|
||||
'lukas-reineke/indent-blankline.nvim',
|
||||
"lukas-reineke/indent-blankline.nvim",
|
||||
opts = {},
|
||||
main = 'ibl',
|
||||
main = "ibl",
|
||||
config = function()
|
||||
require('ibl').setup()
|
||||
end
|
||||
require("ibl").setup()
|
||||
end,
|
||||
}
|
||||
|
@ -4,14 +4,16 @@ return {
|
||||
cmd = { "MarkdownPreviewToggle", "MarkdownPreview", "MarkdownPreviewStop" },
|
||||
ft = { "markdown" },
|
||||
build = function(plugin)
|
||||
if vim.fn.executable "npx" then
|
||||
if vim.fn.executable("npx") then
|
||||
vim.cmd("!cd " .. plugin.dir .. " && cd app && npx --yes yarn install")
|
||||
else
|
||||
vim.cmd [[Lazy load markdown-preview.nvim]]
|
||||
vim.cmd([[Lazy load markdown-preview.nvim]])
|
||||
vim.fn["mkdp#util#install"]()
|
||||
end
|
||||
end,
|
||||
init = function()
|
||||
if vim.fn.executable "npx" then vim.g.mkdp_filetypes = { "markdown" } end
|
||||
if vim.fn.executable("npx") then
|
||||
vim.g.mkdp_filetypes = { "markdown" }
|
||||
end
|
||||
end,
|
||||
}
|
||||
|
@ -2,16 +2,16 @@ return {
|
||||
"smoka7/multicursors.nvim",
|
||||
event = "VeryLazy",
|
||||
dependencies = {
|
||||
'nvimtools/hydra.nvim',
|
||||
"nvimtools/hydra.nvim",
|
||||
},
|
||||
opts = {},
|
||||
cmd = { 'MCstart', 'MCvisual', 'MCclear', 'MCpattern', 'MCvisualPattern', 'MCunderCursor' },
|
||||
cmd = { "MCstart", "MCvisual", "MCclear", "MCpattern", "MCvisualPattern", "MCunderCursor" },
|
||||
keys = {
|
||||
{
|
||||
mode = { 'v', 'n' },
|
||||
'<leader><leader>c',
|
||||
'<cmd>MCstart<cr>',
|
||||
desc = 'Create a selection for selected text or word under the cursor',
|
||||
mode = { "v", "n" },
|
||||
"<leader><leader>c",
|
||||
"<cmd>MCstart<cr>",
|
||||
desc = "Create a selection for selected text or word under the cursor",
|
||||
},
|
||||
},
|
||||
}
|
||||
|
@ -3,8 +3,8 @@ return {
|
||||
config = function()
|
||||
local opts = { noremap = true, silent = true, desc = "Generate docs" }
|
||||
vim.api.nvim_set_keymap("n", "<leader>gd", ":lua require('neogen').generate()<CR>", opts)
|
||||
require( 'neogen' ).setup( {
|
||||
snippet_engine = "luasnip"
|
||||
} );
|
||||
end
|
||||
require("neogen").setup({
|
||||
snippet_engine = "luasnip",
|
||||
})
|
||||
end,
|
||||
}
|
||||
|
@ -4,5 +4,5 @@ return {
|
||||
event = "VeryLazy",
|
||||
config = function()
|
||||
require("nvim-surround").setup()
|
||||
end
|
||||
end,
|
||||
}
|
||||
|
@ -24,30 +24,33 @@ M.sudo_exec = function(cmd, print_output)
|
||||
print(out)
|
||||
return false
|
||||
end
|
||||
if print_output then print("\r\n", out) end
|
||||
if print_output then
|
||||
print("\r\n", out)
|
||||
end
|
||||
return true
|
||||
end
|
||||
|
||||
M.sudo_write = function(tmpfile, filepath)
|
||||
if not tmpfile then tmpfile = vim.fn.tempname() end
|
||||
if not filepath then filepath = vim.fn.expand("%") end
|
||||
if not tmpfile then
|
||||
tmpfile = vim.fn.tempname()
|
||||
end
|
||||
if not filepath then
|
||||
filepath = vim.fn.expand("%")
|
||||
end
|
||||
if not filepath or #filepath == 0 then
|
||||
print("E32: No file name")
|
||||
return
|
||||
end
|
||||
-- `bs=1048576` is equivalent to `bs=1M` for GNU dd or `bs=1m` for BSD dd
|
||||
-- Both `bs=1M` and `bs=1m` are non-POSIX
|
||||
local cmd = string.format("dd if=%s of=%s bs=1048576",
|
||||
vim.fn.shellescape(tmpfile),
|
||||
vim.fn.shellescape(filepath))
|
||||
local cmd = string.format("dd if=%s of=%s bs=1048576", vim.fn.shellescape(tmpfile), vim.fn.shellescape(filepath))
|
||||
-- no need to check error as this fails the entire function
|
||||
vim.api.nvim_exec(string.format("write! %s", tmpfile), true)
|
||||
if M.sudo_exec(cmd) then
|
||||
-- refreshes the buffer and prints the "written" message
|
||||
vim.cmd.checktime()
|
||||
-- exit command mode
|
||||
vim.api.nvim_feedkeys(vim.api.nvim_replace_termcodes(
|
||||
"<Esc>", true, false, true), "n", true)
|
||||
vim.api.nvim_feedkeys(vim.api.nvim_replace_termcodes("<Esc>", true, false, true), "n", true)
|
||||
end
|
||||
vim.fn.delete(tmpfile)
|
||||
end
|
||||
|
Loading…
x
Reference in New Issue
Block a user