Compare commits
13 Commits
4aa0c54fc4
...
main
Author | SHA1 | Date | |
---|---|---|---|
1fbc072e4c | |||
82cb9c4673 | |||
b6bb24d403 | |||
01221c7803 | |||
f4c7857613 | |||
41a5b1d3b5 | |||
83c31fb13f | |||
6e53296a0b | |||
408f84bb8f | |||
1a241a1241 | |||
aac415c3b5 | |||
620a5cd2d6 | |||
ee9066213b |
@@ -3,6 +3,9 @@ This repository contains my NeoVim configs, including some of my snippets.
|
||||
|
||||
It uses Lazy.nvim as the plugin manager, lspconfig for the language server configuration, none-ls for formatting, telescope, tree-sitter and many other plugins. Partially documented and fairly well organized
|
||||
|
||||
## Linter configs
|
||||
You may find the linter configs and setup-scripts for some linters that require some extra setup [here](https://git.janishutz.com/janishutz/dotfiles/)
|
||||
|
||||
# Issues with jdtls
|
||||
Ensure you have jdk21-opnejdk or newer installed. On Arch (and derivatives) you can switch the preferred java version using `archlinux-java set <version name>`
|
||||
|
||||
|
@@ -43,16 +43,15 @@ vim.api.nvim_set_keymap("v", ">", ">gv", { noremap = true, silent = true })
|
||||
keymap.set("n", "E", ":wq!<CR>", opts("write and quit file"))
|
||||
keymap.set("n", "<leader>E", ":lua require('utils').sudo_write()<CR>:q!<CR>", opts("sudo write and quit file"))
|
||||
|
||||
-- Quite file
|
||||
-- Quit file
|
||||
keymap.set("n", "Q", ":q!<CR>", opts("quit file"))
|
||||
|
||||
-- Duplicate line
|
||||
keymap.set("n", "<leader>dd", ":t.<CR>", opts("Duplicate line"))
|
||||
|
||||
-- Editor focus
|
||||
keymap.set("n", "<C-b>", ":wincmd p<CR>", opts("Cycle focus"))
|
||||
|
||||
-- Key Mappings for LaTeX workflow
|
||||
-- LaTeX mappings
|
||||
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
|
||||
@@ -112,17 +111,6 @@ keymap.set("i", "<C-$>", "<End>", opts("Jump to EOL"))
|
||||
keymap.set("i", "<C-0>", "<Home>", opts("Jump to beginning of line"))
|
||||
|
||||
-- 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"))
|
||||
@@ -139,7 +127,7 @@ keymap.set({ "n", "v" }, "C", '"_C', opts())
|
||||
keymap.set({ "n", "v" }, "<leader>d", "d", opts("yank and delete"))
|
||||
keymap.set({ "n", "v" }, "<leader>D", "D", opts("YANK and DELETE to end"))
|
||||
|
||||
-- <leader> + yank/paste/delete uses system clipboard
|
||||
-- <leader> + yank/paste/delete with system clipboard
|
||||
keymap.set({ "n", "v" }, "<leader>y", '"+y', opts("yank to system clipboard"))
|
||||
keymap.set({ "n", "v" }, "<leader>Y", '"+y$', opts("YANK to system clipboard"))
|
||||
keymap.set({ "n", "v" }, "<leader>p", '"+p', opts("paste from system clipboard"))
|
||||
|
@@ -53,6 +53,13 @@ M.on_attach = function(client, bufnr)
|
||||
vim.opt.signcolumn = "yes" -- reserve space for diagnostics
|
||||
end
|
||||
|
||||
M.on_attach_no_formatting = function(client, bufnr)
|
||||
M.on_attach(client, bufnr)
|
||||
|
||||
client.server_capabilities.documentFormattingProvider = false
|
||||
client.server_capabilities.documentRangeFormattingProvider = false
|
||||
end
|
||||
|
||||
-- used to enable autocompletion (assign to every lsp server config)
|
||||
-- local capabilities = cmp_nvim_lsp.default_capabilities()
|
||||
M.capabilities = vim.lsp.protocol.make_client_capabilities()
|
||||
|
@@ -22,14 +22,6 @@ lsp.config("texlab", {
|
||||
on_attach = on_attach,
|
||||
})
|
||||
|
||||
-- ┌ ┐
|
||||
-- │ Spell checking │
|
||||
-- └ ┘
|
||||
lsp.config("textlsp", {
|
||||
capabilities = capabilities,
|
||||
on_attach = on_attach,
|
||||
})
|
||||
|
||||
-- ── Enable configs ───────────────────────────────────────────────
|
||||
local enable = vim.lsp.enable
|
||||
enable("marksman")
|
||||
|
@@ -5,6 +5,7 @@ local lsp = vim.lsp
|
||||
|
||||
local capabilities = require("lsp-options").capabilities
|
||||
local on_attach = require("lsp-options").on_attach
|
||||
local on_attach_no_formatting = require("lsp-options").on_attach_no_formatting
|
||||
|
||||
-- ┌ ┐
|
||||
-- │ HTML, CSS, JSON │
|
||||
@@ -29,7 +30,7 @@ lsp.config("jsonls", {
|
||||
-- └ ┘
|
||||
lsp.config("vue_ls", {
|
||||
capabilities = capabilities,
|
||||
on_attach = on_attach,
|
||||
on_attach = on_attach_no_formatting,
|
||||
filetypes = {
|
||||
"vue",
|
||||
},
|
||||
@@ -40,7 +41,7 @@ lsp.config("vue_ls", {
|
||||
-- └ ┘
|
||||
lsp.config("ts_ls", {
|
||||
capabilities = capabilities,
|
||||
on_attach = on_attach,
|
||||
on_attach = on_attach_no_formatting,
|
||||
init_options = {
|
||||
plugins = {
|
||||
{
|
||||
@@ -64,6 +65,6 @@ lsp.config("ts_ls", {
|
||||
local enable = vim.lsp.enable
|
||||
enable("jsonls")
|
||||
enable("html")
|
||||
enable("css")
|
||||
enable("cssls")
|
||||
enable("vue_ls")
|
||||
enable("ts_ls")
|
||||
|
@@ -25,23 +25,23 @@ return {
|
||||
mason_lspconfig.setup({
|
||||
-- list of servers for mason to install
|
||||
ensure_installed = {
|
||||
"asm-lsp",
|
||||
"asm_lsp",
|
||||
"bashls",
|
||||
"clangd",
|
||||
"cmake",
|
||||
-- "cssls",
|
||||
"dartls",
|
||||
"gopls",
|
||||
"hyprls",
|
||||
"jdtls",
|
||||
"latexindent",
|
||||
"marksman",
|
||||
-- "lua_ls",
|
||||
-- "pyright",
|
||||
"rust_analyzer",
|
||||
"ruby_lsp",
|
||||
-- "ts_ls",
|
||||
"textlsp",
|
||||
"vue_ls"
|
||||
"vue_ls",
|
||||
"verible",
|
||||
},
|
||||
-- auto-install configured servers (with lspconfig)
|
||||
automatic_enable = false
|
||||
|
@@ -15,7 +15,8 @@ return {
|
||||
i = {
|
||||
["<C-j>"] = actions.move_selection_next,
|
||||
["<C-k>"] = actions.move_selection_previous,
|
||||
["<C-q>"] = actions.send_selected_to_qflist + actions.open_qflist, -- TODO investigate
|
||||
["<C-q>"] = actions.smart_add_selected_to_qflist,
|
||||
["<C-A-q>"] = actions.smart_send_selected_to_qflist,
|
||||
},
|
||||
},
|
||||
},
|
||||
@@ -64,5 +65,9 @@ return {
|
||||
-- Implementations
|
||||
opts.desc = "Show implementations"
|
||||
vim.keymap.set("n", "<leader>fi", ":Telescope lsp_implementations<CR>", opts)
|
||||
|
||||
-- quickfix
|
||||
opts.desc = "Show quickfix list"
|
||||
vim.keymap.set("n", "<leader>fq", ":Telescope quickfix<CR>", opts)
|
||||
end,
|
||||
}
|
||||
|
@@ -5,7 +5,7 @@ return {
|
||||
config = function()
|
||||
require("nvim-autopairs").setup({
|
||||
fast_wrap = {
|
||||
map = "<C-e>",
|
||||
map = "<leader>wa",
|
||||
chars = { "{", "[", "(", '"', "'", "`" },
|
||||
},
|
||||
})
|
||||
|
@@ -1,6 +1,14 @@
|
||||
{
|
||||
"docTitle": {
|
||||
"prefix": "prepareDoc",
|
||||
"body": "$BLOCK_COMMENT_START\n*\t\t\t\t$WORKSPACE_NAME - $TM_FILENAME\n*\n*\tCreated by Janis Hutz $CURRENT_MONTH/$CURRENT_DATE/$CURRENT_YEAR, Licensed under ${1|the GPL V3,the MIT,a proprietary,the BSD,the LGPL V3,the Apache|} License\n*\t\t\thttps://janishutz.com, development@janishutz.com\n*\n*\n$BLOCK_COMMENT_END"
|
||||
"body": [
|
||||
"$BLOCK_COMMENT_START",
|
||||
" * $WORKSPACE_NAME - $TM_FILENAME",
|
||||
" *",
|
||||
" * Created by Janis Hutz $CURRENT_MONTH/$CURRENT_DATE/$CURRENT_YEAR, Licensed under ${1|the GPL V3,the MIT,a proprietary,the BSD,the LGPL V3,the Apache|} License",
|
||||
" * https://janishutz.com, development@janishutz.com",
|
||||
" *\n *",
|
||||
"$BLOCK_COMMENT_END"
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user