Migrate vim to neovim (min v0.11)
Install newest vim-releases via appimage from github-page!
This commit is contained in:
@@ -1,6 +1,8 @@
|
|||||||
[font]
|
[font]
|
||||||
size = 9.0
|
size = 9.0
|
||||||
normal = { family = "ComicMono", style = "Regular" }
|
# The NerdFont of ComitMono is created with: https://github.com/ryanoasis/nerd-fonts?tab=readme-ov-file#font-patcher
|
||||||
|
# normal = { family = "ComicMono Nerd Font", style = "Regular" }
|
||||||
|
normal = { family = "ComicMono Nerd Font", style = "Regular" }
|
||||||
|
|
||||||
[env]
|
[env]
|
||||||
WINIT_X11_SCALE_FACTOR = "1.55"
|
WINIT_X11_SCALE_FACTOR = "1.55"
|
||||||
|
|||||||
2
.config/nvim/init.lua
Normal file
2
.config/nvim/init.lua
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
require("config.defaults")
|
||||||
|
require("config.lazy")
|
||||||
35
.config/nvim/lazy-lock.json
Normal file
35
.config/nvim/lazy-lock.json
Normal file
@@ -0,0 +1,35 @@
|
|||||||
|
{
|
||||||
|
"LuaSnip": { "branch": "master", "commit": "458560534a73f7f8d7a11a146c801db00b081df0" },
|
||||||
|
"cmp-buffer": { "branch": "main", "commit": "b74fab3656eea9de20a9b8116afa3cfc4ec09657" },
|
||||||
|
"cmp-cmdline": { "branch": "main", "commit": "d126061b624e0af6c3a556428712dd4d4194ec6d" },
|
||||||
|
"cmp-nvim-lsp": { "branch": "main", "commit": "a8912b88ce488f411177fc8aed358b04dc246d7b" },
|
||||||
|
"cmp-nvim-lsp-signature-help": { "branch": "main", "commit": "031e6ba70b0ad5eee49fd2120ff7a2e325b17fa7" },
|
||||||
|
"cmp-path": { "branch": "main", "commit": "c642487086dbd9a93160e1679a1327be111cbc25" },
|
||||||
|
"cmp_luasnip": { "branch": "master", "commit": "98d9cb5c2c38532bd9bdb481067b20fea8f32e90" },
|
||||||
|
"emmet-vim": { "branch": "master", "commit": "e98397144982d1e75b20d94d55a82de3ec8f648d" },
|
||||||
|
"fugitive-gitea": { "branch": "master", "commit": "d93176028d13820f941c165c14039a6019744a5a" },
|
||||||
|
"fugitive-gitlab.vim": { "branch": "master", "commit": "3584cf7e607ba7822f991d407a8d780e05aae287" },
|
||||||
|
"gitsigns.nvim": { "branch": "main", "commit": "c7d37ca22b461f64e26f8f6701b2586128ed0bef" },
|
||||||
|
"goyo.vim": { "branch": "master", "commit": "fa0263d456dd43f5926484d1c4c7022dfcb21ba9" },
|
||||||
|
"gruvbox.nvim": { "branch": "main", "commit": "58a2cda2e953a99e2f87c12b7fb4602da4e0709c" },
|
||||||
|
"lazy.nvim": { "branch": "main", "commit": "6c3bda4aca61a13a9c63f1c1d1b16b9d3be90d7a" },
|
||||||
|
"limelight.vim": { "branch": "master", "commit": "0c8cc7f503a775c505dc9c67f1f5041ab4d5f1fd" },
|
||||||
|
"lualine.nvim": { "branch": "master", "commit": "a94fc68960665e54408fe37dcf573193c4ce82c9" },
|
||||||
|
"mason-lspconfig.nvim": { "branch": "main", "commit": "7f0bf635082bb9b7d2b37766054526a6ccafdb85" },
|
||||||
|
"mason.nvim": { "branch": "main", "commit": "7dc4facca9702f95353d5a1f87daf23d78e31c2a" },
|
||||||
|
"nvim-autopairs": { "branch": "master", "commit": "23320e75953ac82e559c610bec5a90d9c6dfa743" },
|
||||||
|
"nvim-cmp": { "branch": "main", "commit": "b5311ab3ed9c846b585c0c15b7559be131ec4be9" },
|
||||||
|
"nvim-lspconfig": { "branch": "master", "commit": "d6dc63670d3dc5204b1e874af4cbf340cb5d9d18" },
|
||||||
|
"nvim-tree.lua": { "branch": "master", "commit": "0a52012d611f3c1492b8d2aba363fabf734de91d" },
|
||||||
|
"nvim-treesitter": { "branch": "master", "commit": "42fc28ba918343ebfd5565147a42a26580579482" },
|
||||||
|
"nvim-ts-autotag": { "branch": "main", "commit": "a1d526af391f6aebb25a8795cbc05351ed3620b5" },
|
||||||
|
"nvim-web-devicons": { "branch": "master", "commit": "3362099de3368aa620a8105b19ed04c2053e38c0" },
|
||||||
|
"plenary.nvim": { "branch": "master", "commit": "b9fd5226c2f76c951fc8ed5923d85e4de065e509" },
|
||||||
|
"telescope.nvim": { "branch": "master", "commit": "b4da76be54691e854d3e0e02c36b0245f945c2c7" },
|
||||||
|
"toggleterm.nvim": { "branch": "main", "commit": "9a88eae817ef395952e08650b3283726786fb5fb" },
|
||||||
|
"vim-fubitive": { "branch": "master", "commit": "c85ca8fa2098aa05e816f5d0839a0dad6bfcca5a" },
|
||||||
|
"vim-fugitive": { "branch": "master", "commit": "61b51c09b7c9ce04e821f6cf76ea4f6f903e3cf4" },
|
||||||
|
"vim-rhubarb": { "branch": "master", "commit": "5496d7c94581c4c9ad7430357449bb57fc59f501" },
|
||||||
|
"vimwiki": { "branch": "dev", "commit": "72792615e739d0eb54a9c8f7e0a46a6e2407c9e8" },
|
||||||
|
"which-key.nvim": { "branch": "main", "commit": "370ec46f710e058c9c1646273e6b225acf47cbed" }
|
||||||
|
}
|
||||||
119
.config/nvim/lua/config/defaults.lua
Normal file
119
.config/nvim/lua/config/defaults.lua
Normal file
@@ -0,0 +1,119 @@
|
|||||||
|
vim.g.mapleader = " "
|
||||||
|
vim.g.maplocalleader = " "
|
||||||
|
|
||||||
|
-- look for modifier-lines in files and apply them
|
||||||
|
vim.opt.modeline = true
|
||||||
|
vim.opt.modelineexpr = true
|
||||||
|
|
||||||
|
-- do no enter a linebreak at end of files (not unix-like, since it makes text-files binary for unix!)
|
||||||
|
vim.opt.fixendofline = false
|
||||||
|
|
||||||
|
-- improve line numbering
|
||||||
|
vim.opt.number = true
|
||||||
|
vim.opt.relativenumber = true
|
||||||
|
|
||||||
|
-- highlight current line
|
||||||
|
vim.opt.cursorline = true
|
||||||
|
|
||||||
|
-- show meaningful chars for non-printable situations, e.g. nbsp or wrappings
|
||||||
|
vim.opt.list = true
|
||||||
|
vim.opt.listchars = "tab:› ,trail:·,nbsp:␣,extends:»,precedes:«"
|
||||||
|
|
||||||
|
-- highlight search results
|
||||||
|
vim.opt.hlsearch = true
|
||||||
|
vim.cmd([[highlight LineNr ctermfg=7]])
|
||||||
|
vim.cmd([[highlight CursorLineNr ctermbg=green]])
|
||||||
|
vim.cmd([[highlight CursorLine ctermbg=green]])
|
||||||
|
|
||||||
|
-- do not wrap long lines
|
||||||
|
vim.opt.wrap = false
|
||||||
|
|
||||||
|
-- break lines at words, not chars
|
||||||
|
vim.opt.linebreak = true
|
||||||
|
|
||||||
|
-- indent by 2 chars by default, make tabstops also 2 chars and expand tabs to spaces
|
||||||
|
vim.opt.tabstop = 8
|
||||||
|
vim.opt.softtabstop = 2
|
||||||
|
vim.opt.softtabstop = -1
|
||||||
|
vim.opt.shiftwidth = 2
|
||||||
|
vim.opt.expandtab = true
|
||||||
|
|
||||||
|
-- fold code after some nesting
|
||||||
|
vim.opt.foldlevel = 100
|
||||||
|
|
||||||
|
-- make backspace behave like in other applications
|
||||||
|
vim.opt.backspace = "indent,eol,start"
|
||||||
|
|
||||||
|
-- simply clear search
|
||||||
|
vim.keymap.set("n", "<Leader>/", "<Cmd>nohlsearch<CR>")
|
||||||
|
|
||||||
|
-- add some quickfix shortcuts for easier navigation
|
||||||
|
vim.keymap.set("n", "<Leader>cn", "<Cmd>cnext<CR>")
|
||||||
|
vim.keymap.set("n", "<Leader>n", "<Cmd>cnext<CR>")
|
||||||
|
vim.keymap.set("n", "<Leader>cp", "<Cmd>cprevious<CR>")
|
||||||
|
vim.keymap.set("n", "<Leader>p", "<Cmd>cprevious<CR>")
|
||||||
|
vim.keymap.set("n", "<Leader>cc", "<Cmd>cclose<CR>")
|
||||||
|
vim.keymap.set("n", "<Leader>co", "<Cmd>copen<CR>")
|
||||||
|
vim.keymap.set("n", "<Leader>cf", "<Cmd>cfirst<CR>")
|
||||||
|
vim.keymap.set("n", "<Leader>cl", "<Cmd>clast<CR>")
|
||||||
|
|
||||||
|
-- simple spellchecks
|
||||||
|
vim.keymap.set("n", "<Leader>ss", "<Cmd>set spell!<CR>")
|
||||||
|
vim.keymap.set("n", "<Leader>sd", "<Cmd>set spelllang=de_de<CR>")
|
||||||
|
vim.keymap.set("n", "<Leader>se", "<Cmd>set spelllang=en_us<CR>")
|
||||||
|
|
||||||
|
-- make navigation easer on a german keyboard!
|
||||||
|
vim.keymap.set("n", "ä", "]")
|
||||||
|
vim.keymap.set("n", "ö", "[")
|
||||||
|
vim.keymap.set("n", "<C-ä>", "<C-]>")
|
||||||
|
vim.keymap.set("n", "<C-ö>", "<C-[>")
|
||||||
|
vim.keymap.set("n", ",", ";")
|
||||||
|
vim.keymap.set("n", ";", ",")
|
||||||
|
|
||||||
|
-- simpler navigation in diffs
|
||||||
|
if vim.api.nvim_win_get_option(0, "diff") then
|
||||||
|
vim.keymap.set("n", "<Leader>1", "<Cmd>diffget LOCAL<CR>")
|
||||||
|
vim.keymap.set("n", "<Leader>2", "<Cmd>diffget BASE<CR>")
|
||||||
|
vim.keymap.set("n", "<Leader>3", "<Cmd>diffget REMOTE<CR>")
|
||||||
|
vim.keymap.set("n", "<Leader>n", "]c")
|
||||||
|
vim.keymap.set("n", "<Leader>p", "[c")
|
||||||
|
end
|
||||||
|
|
||||||
|
-- autocommands for specific files
|
||||||
|
local configgroup = vim.api.nvim_create_augroup('configgroup', { clear = true })
|
||||||
|
|
||||||
|
function fix_filetype(pattern, filetype)
|
||||||
|
vim.api.nvim_create_autocmd({ "BufRead", "BufNewFile" }, {
|
||||||
|
pattern = pattern,
|
||||||
|
group = configgroup,
|
||||||
|
callback = function()
|
||||||
|
vim.opt.filetype = filetype
|
||||||
|
end,
|
||||||
|
})
|
||||||
|
end
|
||||||
|
|
||||||
|
-- fix filetypes
|
||||||
|
fix_filetype("*Containerfile", "dockerfile")
|
||||||
|
fix_filetype("~/.config/git/*", "gitconfig")
|
||||||
|
|
||||||
|
-- adjust settings per filetype
|
||||||
|
-- git
|
||||||
|
vim.api.nvim_create_autocmd("FileType", {
|
||||||
|
pattern = "gitconfig",
|
||||||
|
group = configgroup,
|
||||||
|
callback = function()
|
||||||
|
vim.opt_local.expandtab = false
|
||||||
|
vim.opt_local.shiftwidth = 4
|
||||||
|
vim.opt_local.tabstop = 4
|
||||||
|
end,
|
||||||
|
})
|
||||||
|
-- lua
|
||||||
|
vim.api.nvim_create_autocmd("FileType", {
|
||||||
|
pattern = "lua",
|
||||||
|
group = configgroup,
|
||||||
|
callback = function()
|
||||||
|
vim.opt_local.expandtab = false
|
||||||
|
vim.opt_local.shiftwidth = 4
|
||||||
|
vim.opt_local.tabstop = 4
|
||||||
|
end,
|
||||||
|
})
|
||||||
35
.config/nvim/lua/config/lazy.lua
Normal file
35
.config/nvim/lua/config/lazy.lua
Normal file
@@ -0,0 +1,35 @@
|
|||||||
|
-- Bootstrap lazy.nvim
|
||||||
|
local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
|
||||||
|
if not (vim.uv or vim.loop).fs_stat(lazypath) then
|
||||||
|
local lazyrepo = "https://github.com/folke/lazy.nvim.git"
|
||||||
|
local out = vim.fn.system({ "git", "clone", "--filter=blob:none", "--branch=stable", lazyrepo, lazypath })
|
||||||
|
if vim.v.shell_error ~= 0 then
|
||||||
|
vim.api.nvim_echo({
|
||||||
|
{ "Failed to clone lazy.nvim:\n", "ErrorMsg" },
|
||||||
|
{ out, "WarningMsg" },
|
||||||
|
{ "\nPress any key to exit..." },
|
||||||
|
}, true, {})
|
||||||
|
vim.fn.getchar()
|
||||||
|
os.exit(1)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
vim.opt.rtp:prepend(lazypath)
|
||||||
|
|
||||||
|
-- Make sure to setup `mapleader` and `maplocalleader` before
|
||||||
|
-- loading lazy.nvim so that mappings are correct.
|
||||||
|
-- This is also a good place to setup other settings (vim.opt)
|
||||||
|
-- vim.g.mapleader = " "
|
||||||
|
-- vim.g.maplocalleader = "\\"
|
||||||
|
|
||||||
|
-- Setup lazy.nvim
|
||||||
|
require("lazy").setup({
|
||||||
|
spec = {
|
||||||
|
-- import your plugins
|
||||||
|
{ import = "plugins" },
|
||||||
|
},
|
||||||
|
-- Configure any other settings here. See the documentation for more details.
|
||||||
|
-- colorscheme that will be used when installing plugins.
|
||||||
|
install = { colorscheme = { "habamax" } },
|
||||||
|
-- automatically check for plugin updates
|
||||||
|
checker = { enabled = true, notify = false },
|
||||||
|
})
|
||||||
67
.config/nvim/lua/plugins/autocompletion.lua
Normal file
67
.config/nvim/lua/plugins/autocompletion.lua
Normal file
@@ -0,0 +1,67 @@
|
|||||||
|
return {
|
||||||
|
"hrsh7th/nvim-cmp",
|
||||||
|
dependencies = {
|
||||||
|
"hrsh7th/cmp-nvim-lsp", -- language server as completion source
|
||||||
|
"hrsh7th/cmp-buffer", -- buffers as completion source
|
||||||
|
"hrsh7th/cmp-path", -- paths as completion source
|
||||||
|
"hrsh7th/cmp-cmdline", -- cmdline as completion source
|
||||||
|
|
||||||
|
"hrsh7th/cmp-nvim-lsp-signature-help", -- emphasize current parameter in completions
|
||||||
|
|
||||||
|
"L3MON4D3/LuaSnip", -- I use luasnip anyway
|
||||||
|
"saadparwaiz1/cmp_luasnip", -- luasnip completion source
|
||||||
|
},
|
||||||
|
config = function()
|
||||||
|
local cmp = require("cmp")
|
||||||
|
local luasnip = require("luasnip")
|
||||||
|
require("luasnip.loaders.from_snipmate").lazy_load()
|
||||||
|
require("luasnip.loaders.from_lua").lazy_load()
|
||||||
|
local has_words_before = function ()
|
||||||
|
local line, col = unpack(vim.api.nvim_win_get_cursor(0))
|
||||||
|
return col ~= 0 and vim.api.nvim_buf_get_lines(0, line - 1, line, true)[1]:sub(col, col):match("%s") == nil
|
||||||
|
end
|
||||||
|
cmp.setup({
|
||||||
|
snippet = {
|
||||||
|
expand = function(args)
|
||||||
|
luasnip.lsp_expand(args.body)
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
mapping = {
|
||||||
|
["<C-p>"] = cmp.mapping.select_prev_item(),
|
||||||
|
["<C-n>"] = cmp.mapping.select_next_item(),
|
||||||
|
["<C-Space>"] = cmp.mapping.complete(),
|
||||||
|
["<CR>"] = cmp.mapping.confirm({
|
||||||
|
behavior = cmp.ConfirmBehavior.Replace,
|
||||||
|
select = true
|
||||||
|
}),
|
||||||
|
["<Tab>"] = cmp.mapping(function(fallback)
|
||||||
|
if cmp.visible() then
|
||||||
|
cmp.select_next_item()
|
||||||
|
elseif luasnip.expand_or_jumpable() then
|
||||||
|
luasnip.expand_or_jump()
|
||||||
|
elseif has_words_before() then
|
||||||
|
cmp.complete()
|
||||||
|
else
|
||||||
|
fallback()
|
||||||
|
end
|
||||||
|
end, { "i", "s" }),
|
||||||
|
["<S-Tab>"] = cmp.mapping(function(fallback)
|
||||||
|
if cmp.visible() then
|
||||||
|
cmp.select_prev_item()
|
||||||
|
elseif luasnip.jumpable(-1) then
|
||||||
|
luasnip.jump(-1)
|
||||||
|
else
|
||||||
|
fallback()
|
||||||
|
end
|
||||||
|
end, { "i", "s" }),
|
||||||
|
},
|
||||||
|
sources = {
|
||||||
|
{ name = "nvim_lsp" },
|
||||||
|
{ name = "nvim_lsp_signature_help" },
|
||||||
|
{ name = "luasnip" },
|
||||||
|
{ name = "buffer" },
|
||||||
|
{ name = "path" },
|
||||||
|
},
|
||||||
|
})
|
||||||
|
end,
|
||||||
|
}
|
||||||
4
.config/nvim/lua/plugins/emmet-vim.lua
Normal file
4
.config/nvim/lua/plugins/emmet-vim.lua
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
return {
|
||||||
|
"mattn/emmet-vim",
|
||||||
|
config = function() end,
|
||||||
|
}
|
||||||
22
.config/nvim/lua/plugins/fugitive.lua
Normal file
22
.config/nvim/lua/plugins/fugitive.lua
Normal file
@@ -0,0 +1,22 @@
|
|||||||
|
return {
|
||||||
|
{
|
||||||
|
"tpope/vim-fugitive",
|
||||||
|
lazy = false,
|
||||||
|
keys = {
|
||||||
|
-- replaced by telescope
|
||||||
|
-- { "<Leader>gg", "<Cmd>Ggrep ", desc = "Git grep" },
|
||||||
|
{ "<Leader>gb", "<Cmd>G blame<CR>", desc = "Git blame" },
|
||||||
|
{ "<Leader>gll", "<Cmd>G log --graph --format='%h (%ar) %s :: %aN <%aE>'<CR>", desc = "Git blame" },
|
||||||
|
{ "<Leader>glx", "<Cmd>Gclog -- %<CR>" },
|
||||||
|
{ "<Leader>gl0", "<Cmd>0Gclog -- %<CR>" },
|
||||||
|
},
|
||||||
|
},
|
||||||
|
-- Github integration for :GBrowse
|
||||||
|
{ "tpope/vim-rhubarb" },
|
||||||
|
-- Gitea integration for :GBrowse
|
||||||
|
{ "borissov/fugitive-gitea" },
|
||||||
|
-- Gitlab integration for :GBrowse
|
||||||
|
{ "shumphrey/fugitive-gitlab.vim" },
|
||||||
|
-- Bitbucket integration for :GBrowse
|
||||||
|
{ "tommcdo/vim-fubitive" },
|
||||||
|
}
|
||||||
25
.config/nvim/lua/plugins/gitsigns.lua
Normal file
25
.config/nvim/lua/plugins/gitsigns.lua
Normal file
@@ -0,0 +1,25 @@
|
|||||||
|
local function my_attach_change(bufnr)
|
||||||
|
local gs = require "gitsigns"
|
||||||
|
vim.keymap.set("n", "<Leader>tb", gs.toggle_current_line_blame, { buffer = bufnr })
|
||||||
|
end
|
||||||
|
|
||||||
|
return {
|
||||||
|
"lewis6991/gitsigns.nvim",
|
||||||
|
lazy = false,
|
||||||
|
opts = {
|
||||||
|
on_attach = my_attach_change,
|
||||||
|
signs = {
|
||||||
|
add = { text = "+" },
|
||||||
|
change = { text = "~" },
|
||||||
|
delete = { text = "-" },
|
||||||
|
topdelete = { text = "-" },
|
||||||
|
},
|
||||||
|
signs_staged = {
|
||||||
|
add = { text = "+" },
|
||||||
|
change = { text = "~" },
|
||||||
|
delete = { text = "-" },
|
||||||
|
topdelete = { text = "-" },
|
||||||
|
},
|
||||||
|
word_diff = false
|
||||||
|
},
|
||||||
|
}
|
||||||
24
.config/nvim/lua/plugins/goyo.lua
Normal file
24
.config/nvim/lua/plugins/goyo.lua
Normal file
@@ -0,0 +1,24 @@
|
|||||||
|
return {
|
||||||
|
"junegunn/goyo.vim",
|
||||||
|
dependencies = {
|
||||||
|
"junegunn/limelight.vim",
|
||||||
|
"nvim-lualine/lualine.nvim",
|
||||||
|
},
|
||||||
|
lazy = false,
|
||||||
|
config = function ()
|
||||||
|
vim.keymap.set("n", "<Leader>gg", function()
|
||||||
|
require('lualine').hide()
|
||||||
|
vim.cmd([[Goyo]])
|
||||||
|
vim.cmd([[Limelight!! 0.8]])
|
||||||
|
end)
|
||||||
|
end
|
||||||
|
-- "pocco81/true-zen.nvim",
|
||||||
|
-- config = function ()
|
||||||
|
-- vim.keymap.set("n", "<Leader>gwg", function()
|
||||||
|
-- vim.cmd([[TZAtaraxis]])
|
||||||
|
-- end)
|
||||||
|
-- vim.keymap.set("n", "<Leader>gww", function()
|
||||||
|
-- require('lualine').hide()
|
||||||
|
-- end)
|
||||||
|
-- end
|
||||||
|
}
|
||||||
20
.config/nvim/lua/plugins/gruvbox.lua
Normal file
20
.config/nvim/lua/plugins/gruvbox.lua
Normal file
@@ -0,0 +1,20 @@
|
|||||||
|
return {
|
||||||
|
{
|
||||||
|
-- "lifepillar/vim-gruvbox8",
|
||||||
|
-- priority = 1000, --ensure loading before other plugins
|
||||||
|
-- opts = {},
|
||||||
|
-- config = function()
|
||||||
|
-- vim.g.gruvbox_contrast_dark = "hard"
|
||||||
|
-- --vim.cmd("colorscheme gruvbox8")
|
||||||
|
-- end,
|
||||||
|
--}, {
|
||||||
|
"ellisonleao/gruvbox.nvim",
|
||||||
|
priority = 1000,
|
||||||
|
opts = {
|
||||||
|
contrast = "hard",
|
||||||
|
},
|
||||||
|
config = function()
|
||||||
|
vim.cmd("colorscheme gruvbox")
|
||||||
|
end
|
||||||
|
}
|
||||||
|
}
|
||||||
115
.config/nvim/lua/plugins/lsp.lua
Normal file
115
.config/nvim/lua/plugins/lsp.lua
Normal file
@@ -0,0 +1,115 @@
|
|||||||
|
local on_attach = function(_, bufnr)
|
||||||
|
local ts = require("telescope.builtin")
|
||||||
|
local opts = { noremap = true, silent = true, buffer = bufnr }
|
||||||
|
vim.keymap.set("n", "<Leader>rn", vim.lsp.buf.rename, opts)
|
||||||
|
vim.keymap.set("n", "<Leader>ca", vim.lsp.buf.code_action, opts)
|
||||||
|
vim.keymap.set("n", "gd", vim.lsp.buf.definition, opts)
|
||||||
|
vim.keymap.set("n", "ge", vim.diagnostic.open_float, opts)
|
||||||
|
vim.keymap.set("n", "gf", function() vim.lsp.buf.format { async = true } end, opts)
|
||||||
|
vim.keymap.set("n", "gi", vim.lsp.buf.implementation, opts)
|
||||||
|
vim.keymap.set("n", "gk", vim.lsp.buf.hover, opts)
|
||||||
|
vim.keymap.set("n", "gK", vim.lsp.buf.signature_help, opts)
|
||||||
|
vim.keymap.set("n", "gn", function() vim.diagnostic.jump({ count = 1, float = true }) end, opts)
|
||||||
|
vim.keymap.set("n", "gN", function() vim.diagnostic.jump({ count = -1, float = true }) end, opts)
|
||||||
|
vim.keymap.set("n", "gr", ts.lsp_references, opts)
|
||||||
|
vim.api.nvim_buf_set_option(bufnr, "omnifunc", "v:lua.vim.lsp.omnifunc")
|
||||||
|
end
|
||||||
|
|
||||||
|
return {
|
||||||
|
"mason-org/mason-lspconfig.nvim",
|
||||||
|
dependencies = {
|
||||||
|
{ "mason-org/mason.nvim", opts = {} },
|
||||||
|
"neovim/nvim-lspconfig",
|
||||||
|
"nvim-telescope/telescope.nvim",
|
||||||
|
"hrsh7th/nvim-cmp", -- IMPORTANT: autocomplete must be configured correctly!
|
||||||
|
-- {
|
||||||
|
-- 'stevearc/dressing.nvim',
|
||||||
|
-- opts = {},
|
||||||
|
-- event='VeryLazy'
|
||||||
|
-- }
|
||||||
|
},
|
||||||
|
opts = {},
|
||||||
|
config = function()
|
||||||
|
local masonlsp = require("mason-lspconfig")
|
||||||
|
masonlsp.setup({
|
||||||
|
-- possibilities: https://mason-registry.dev/registry/list
|
||||||
|
ensure_installed = {
|
||||||
|
"bashls",
|
||||||
|
"cssls",
|
||||||
|
"docker_language_server",
|
||||||
|
"eslint",
|
||||||
|
"gopls",
|
||||||
|
"harper_ls",
|
||||||
|
"html",
|
||||||
|
"jsonls",
|
||||||
|
"lua_ls",
|
||||||
|
"terraformls",
|
||||||
|
"ts_ls",
|
||||||
|
"vue_ls",
|
||||||
|
},
|
||||||
|
})
|
||||||
|
local vue_language_server_path = vim.fn.expand '$MASON/packages' ..
|
||||||
|
'/vue-language-server' .. '/node_modules/@vue/language-server'
|
||||||
|
local vue_plugin = {
|
||||||
|
name = '@vue/typescript-plugin',
|
||||||
|
location = vue_language_server_path,
|
||||||
|
languages = { 'vue' },
|
||||||
|
configNamespace = 'typescript',
|
||||||
|
}
|
||||||
|
local home_dir = os.getenv('HOME')
|
||||||
|
local capabilities = require("cmp_nvim_lsp").default_capabilities()
|
||||||
|
capabilities.textDocument.completion.completionItem.snippetSupport = true
|
||||||
|
local opts = {
|
||||||
|
on_attach = on_attach,
|
||||||
|
capabilities = capabilities,
|
||||||
|
}
|
||||||
|
-- A list of language-server-configs https://github.com/neovim/nvim-lspconfig/blob/master/doc/configs.md
|
||||||
|
vim.lsp.config("bashls", opts)
|
||||||
|
vim.lsp.config("cssls", opts)
|
||||||
|
vim.lsp.config("docker_language_server", opts)
|
||||||
|
vim.lsp.config("eslint", {})
|
||||||
|
vim.lsp.config("gopls", opts)
|
||||||
|
vim.lsp.config("harper_ls", { -- spelling and grammer checks
|
||||||
|
on_attach = on_attach,
|
||||||
|
capabilities = capabilities,
|
||||||
|
filetypes = { "markdown", "asciidoc", "text", "vimwiki" },
|
||||||
|
})
|
||||||
|
vim.lsp.config("html", opts)
|
||||||
|
vim.lsp.config("jsonls", opts)
|
||||||
|
vim.lsp.config("lua_ls", {
|
||||||
|
on_attach = on_attach,
|
||||||
|
capabilities = capabilities,
|
||||||
|
settings = {
|
||||||
|
Lua = {
|
||||||
|
diagnostics = {
|
||||||
|
globals = { "vim" }
|
||||||
|
},
|
||||||
|
telemetry = { enable = false },
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
vim.lsp.config("terraformls", opts)
|
||||||
|
vim.lsp.config("ts_ls", {
|
||||||
|
on_attach = on_attach,
|
||||||
|
capabilities = capabilities,
|
||||||
|
init_options = {
|
||||||
|
plugins = {
|
||||||
|
vue_plugin,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
filetypes = { 'typescript', 'javascript', 'javascriptreact', 'typescriptreact', 'vue' },
|
||||||
|
})
|
||||||
|
vim.lsp.config('vue_ls', opts)
|
||||||
|
vim.lsp.enable({
|
||||||
|
"cssls",
|
||||||
|
"eslint",
|
||||||
|
"html",
|
||||||
|
"harper_ls",
|
||||||
|
"jsonls",
|
||||||
|
"lua_ls",
|
||||||
|
"terraformls",
|
||||||
|
"ts_ls",
|
||||||
|
"vue_ls",
|
||||||
|
})
|
||||||
|
end,
|
||||||
|
}
|
||||||
15
.config/nvim/lua/plugins/lualine.lua
Normal file
15
.config/nvim/lua/plugins/lualine.lua
Normal file
@@ -0,0 +1,15 @@
|
|||||||
|
return {
|
||||||
|
"nvim-lualine/lualine.nvim",
|
||||||
|
dependencies = {
|
||||||
|
'nvim-tree/nvim-web-devicons'
|
||||||
|
},
|
||||||
|
opts = {
|
||||||
|
sections = {
|
||||||
|
lualine_c = { { "filename", path = 1 } },
|
||||||
|
},
|
||||||
|
inactive_sections = {
|
||||||
|
lualine_c = { { 'filename', path = 1 } },
|
||||||
|
},
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
||||||
4
.config/nvim/lua/plugins/luasnip.lua
Normal file
4
.config/nvim/lua/plugins/luasnip.lua
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
return {
|
||||||
|
"L3MON4D3/LuaSnip",
|
||||||
|
version = "v2.*", -- just because the docs mention it
|
||||||
|
}
|
||||||
7
.config/nvim/lua/plugins/nvim-autopairs.lua
Normal file
7
.config/nvim/lua/plugins/nvim-autopairs.lua
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
return {
|
||||||
|
-- add closing parenthesis automatically
|
||||||
|
"windwp/nvim-autopairs",
|
||||||
|
event = "InsertEnter",
|
||||||
|
config = true,
|
||||||
|
opts = {},
|
||||||
|
}
|
||||||
16
.config/nvim/lua/plugins/nvim-telescope.lua
Normal file
16
.config/nvim/lua/plugins/nvim-telescope.lua
Normal file
@@ -0,0 +1,16 @@
|
|||||||
|
return {
|
||||||
|
"nvim-telescope/telescope.nvim",
|
||||||
|
dependencies = {
|
||||||
|
'nvim-lua/plenary.nvim'
|
||||||
|
-- do not forget to install ripgrep!!!
|
||||||
|
-- https://github.com/nvim-telescope/telescope.nvim/issues/522#issuecomment-1374795374
|
||||||
|
},
|
||||||
|
opts = {
|
||||||
|
},
|
||||||
|
config = function()
|
||||||
|
local ts = require("telescope.builtin")
|
||||||
|
vim.keymap.set("n", "<C-p>", ts.find_files)
|
||||||
|
vim.keymap.set("n", "<Leader>fg", ts.live_grep)
|
||||||
|
vim.keymap.set("n", "<Leader>ff", ts.oldfiles)
|
||||||
|
end,
|
||||||
|
}
|
||||||
116
.config/nvim/lua/plugins/nvim-tree.lua
Normal file
116
.config/nvim/lua/plugins/nvim-tree.lua
Normal file
@@ -0,0 +1,116 @@
|
|||||||
|
local function my_attach_change(bufnr)
|
||||||
|
local api = require "nvim-tree.api"
|
||||||
|
local function opts(desc)
|
||||||
|
return { desc = "nvim-tree: " .. desc, buffer = bufnr, noremap = true, silent = true, nowait = true }
|
||||||
|
end
|
||||||
|
api.config.mappings.default_on_attach(bufnr)
|
||||||
|
vim.keymap.set("n", "?", api.tree.toggle_help, opts("Help"))
|
||||||
|
vim.keymap.set("n", "I", api.tree.toggle_hidden_filter, opts("Toggle Filter: Dotfiles"))
|
||||||
|
-- vim.keymap.set("n", "O", function()
|
||||||
|
-- api.node.open.edit()
|
||||||
|
-- current = api.tree.get_node_under_cursor()
|
||||||
|
-- if current.type ~= "directory" then
|
||||||
|
-- api.tree.close()
|
||||||
|
-- end
|
||||||
|
-- end, opts("Open and clode Tree"))
|
||||||
|
-- vim.keymap.set("n", "o", api.node.open.edit, opts("Open"))
|
||||||
|
|
||||||
|
-- add my most used NERDTree mappings
|
||||||
|
-- vim.keymap.set("n", "ma", api.fs.create, opts("NERDTree add a childnode"))
|
||||||
|
-- vim.keymap.set("n", "mc", function() api.fs.copy.node(); api.fs.paste(); end, opts("NERDTree copy the current node"))
|
||||||
|
-- vim.keymap.set("n", "md", api.fs.remove, opts("NERDTree delete the current node"))
|
||||||
|
-- vim.keymap.set("n", "mm", api.fs.rename_full, opts("NERDTree move the current node"))
|
||||||
|
-- vim.keymap.set("n", "mo", api.node.run.system, opts("NERDTree open the current node with system editor"))
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
|
return {
|
||||||
|
{
|
||||||
|
"nvim-tree/nvim-tree.lua",
|
||||||
|
lazy = false,
|
||||||
|
keys = {
|
||||||
|
{ "<Leader>e", "<CMD>NvimTreeFindFile<CR>", desc = "NvimTree" },
|
||||||
|
{ "<Leader>E", "<CMD>NvimTreeClose<CR>", desc = "Close NvimTree" },
|
||||||
|
},
|
||||||
|
opts = {
|
||||||
|
on_attach = my_attach_change,
|
||||||
|
filters = {
|
||||||
|
dotfiles = true,
|
||||||
|
git_ignored = false,
|
||||||
|
},
|
||||||
|
view = {
|
||||||
|
signcolumn = "no",
|
||||||
|
width = 40,
|
||||||
|
},
|
||||||
|
renderer = {
|
||||||
|
-- root_folder_label = ":~",
|
||||||
|
-- root_folder_label = ":.",
|
||||||
|
root_folder_label = function(path)
|
||||||
|
return vim.fn.fnamemodify(path, ":h:t") .. "/" .. vim.fn.fnamemodify(path, ":t") .. "/"
|
||||||
|
end,
|
||||||
|
group_empty = true,
|
||||||
|
icons = {
|
||||||
|
padding = {
|
||||||
|
icon = " ",
|
||||||
|
},
|
||||||
|
--padding = {
|
||||||
|
-- folder_arrow = " ",
|
||||||
|
-- icon = "",
|
||||||
|
--},
|
||||||
|
--show = {
|
||||||
|
-- file = false,
|
||||||
|
-- folder = false,
|
||||||
|
-- folder_arrow = true,
|
||||||
|
--},
|
||||||
|
--glyphs = {
|
||||||
|
-- folder = {
|
||||||
|
-- arrow_closed = "▸ ",
|
||||||
|
-- arrow_open = "▾ ",
|
||||||
|
-- },
|
||||||
|
-- git = {
|
||||||
|
-- unstaged = "✗ ",
|
||||||
|
-- staged = "✓ ",
|
||||||
|
-- unmerged = " ",
|
||||||
|
-- renamed = "➜ ",
|
||||||
|
-- untracked = "★ ",
|
||||||
|
-- deleted = " ",
|
||||||
|
-- ignored = "◌ ",
|
||||||
|
-- },
|
||||||
|
--},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
diagnostics = {
|
||||||
|
enable = true,
|
||||||
|
icons = {
|
||||||
|
hint = " ",
|
||||||
|
info = " ",
|
||||||
|
warning = " ",
|
||||||
|
error = " ",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
init = function()
|
||||||
|
vim.g.loaded_netrw = 1
|
||||||
|
vim.g.loaded_netrwPlugin = 1
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"nvim-tree/nvim-web-devicons",
|
||||||
|
},
|
||||||
|
-- {
|
||||||
|
-- "scrooloose/nerdtree",
|
||||||
|
-- init = function()
|
||||||
|
-- vim.g.NERDTreeGitStatusShowIgnored = 1
|
||||||
|
-- vim.cmd([[let NERDTreeMinimalUI=1]])
|
||||||
|
-- vim.cmd([[let NERDTreeDirArrows=1]])
|
||||||
|
-- vim.cmd([[let NERDTreeAutoDeleteBuffer=1]])
|
||||||
|
-- -- vim.keymap.set("n", "<Leader>n", ":NERDTreeToggle<CR>")
|
||||||
|
-- end,
|
||||||
|
-- keys = {
|
||||||
|
-- { "<Leader>e", "<CMD>NERDTreeFocus<CR>", desc = "NERDTree" },
|
||||||
|
-- },
|
||||||
|
-- },
|
||||||
|
-- {
|
||||||
|
-- "Xuyuanp/nerdtree-git-plugin",
|
||||||
|
-- },
|
||||||
|
}
|
||||||
20
.config/nvim/lua/plugins/nvim-treesitter.lua
Normal file
20
.config/nvim/lua/plugins/nvim-treesitter.lua
Normal file
@@ -0,0 +1,20 @@
|
|||||||
|
return {
|
||||||
|
"nvim-treesitter/nvim-treesitter",
|
||||||
|
lazy = false,
|
||||||
|
config = function()
|
||||||
|
local configs = require("nvim-treesitter.configs")
|
||||||
|
configs.setup({
|
||||||
|
ensure_installed = "all",
|
||||||
|
ignore_install = { "ipkg" },
|
||||||
|
sync_install = false,
|
||||||
|
auto_install = true,
|
||||||
|
highlight = { enable = true },
|
||||||
|
indent = { enable = true },
|
||||||
|
})
|
||||||
|
vim.opt.foldexpr = "v:lua.vim.treesitter.foldexpr()"
|
||||||
|
--vim.opt.foldtext = "v:lua.vim.treesitter.foldtext()"
|
||||||
|
vim.opt.foldmethod = "expr"
|
||||||
|
end,
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
10
.config/nvim/lua/plugins/toggleterm.lua
Normal file
10
.config/nvim/lua/plugins/toggleterm.lua
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
vim.keymap.set('t', '<esc>', [[<C-\><C-n>]], {})
|
||||||
|
vim.keymap.set('t', '<C-d>', [[<C-\><C-n><Cmd>ToggleTerm<CR>]], {})
|
||||||
|
|
||||||
|
return {
|
||||||
|
"akinsho/toggleterm.nvim",
|
||||||
|
opts = {},
|
||||||
|
keys = {
|
||||||
|
{ "<C-d>", [[<Cmd>ToggleTerm<CR>]] },
|
||||||
|
},
|
||||||
|
}
|
||||||
8
.config/nvim/lua/plugins/ts-autotag.lua
Normal file
8
.config/nvim/lua/plugins/ts-autotag.lua
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
return {
|
||||||
|
-- add closing HTML tags automatically
|
||||||
|
"windwp/nvim-ts-autotag",
|
||||||
|
lazy = false,
|
||||||
|
config = function()
|
||||||
|
require 'nvim-ts-autotag'.setup()
|
||||||
|
end,
|
||||||
|
}
|
||||||
30
.config/nvim/lua/plugins/vimwiki.lua
Normal file
30
.config/nvim/lua/plugins/vimwiki.lua
Normal file
@@ -0,0 +1,30 @@
|
|||||||
|
local wikipath = "~/Development/nemoinho/gitea.nehrke.info/nemoinho/vimwiki/"
|
||||||
|
--vim.cmd("let g:vimwiki_list = [{'path': '~/Development/nemoinho/gitea.nehrke.info/nemoinho/vimwiki/' }]")
|
||||||
|
vim.g.vimwiki_table_mappings = 0
|
||||||
|
vim.g.vimwiki_list = { { path = wikipath, auto_export = 1 } }
|
||||||
|
vim.g.vimwiki_autowriteall = 0
|
||||||
|
vim.g.vimwiki_url_maxsave = 0
|
||||||
|
local vimwikiconfig = vim.api.nvim_create_augroup('configgroup', { clear = true })
|
||||||
|
vim.api.nvim_create_autocmd({ "BufRead", "BufNewFile" }, {
|
||||||
|
pattern = "diary.wiki",
|
||||||
|
group = vimwikiconfig,
|
||||||
|
callback = function() vim.cmd([[VimwikiDiaryGenerateLinks]]) end,
|
||||||
|
})
|
||||||
|
vim.api.nvim_create_autocmd("FileType", {
|
||||||
|
pattern = "vimwiki",
|
||||||
|
group = vimwikiconfig,
|
||||||
|
callback = function()
|
||||||
|
vim.opt_local.wrap = true
|
||||||
|
vim.opt_local.number = false
|
||||||
|
vim.opt_local.relativenumber = false
|
||||||
|
vim.keymap.set("n", "<Leader>ws", function()
|
||||||
|
vim.cmd("call system('sleep 2 && cd " .. wikipath .. " && git add . && git commit -m " .. '"Auto commit"' .. " && git push')")
|
||||||
|
end)
|
||||||
|
vim.keymap.set("n", "<Leader>we", "<Cmd>VimwikiMakeDiaryNote<CR>")
|
||||||
|
end,
|
||||||
|
})
|
||||||
|
|
||||||
|
return {
|
||||||
|
"vimwiki/vimwiki",
|
||||||
|
config = function() end,
|
||||||
|
}
|
||||||
4
.config/nvim/lua/plugins/which-key.lua
Normal file
4
.config/nvim/lua/plugins/which-key.lua
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
return {
|
||||||
|
"folke/which-key.nvim",
|
||||||
|
opts = {},
|
||||||
|
}
|
||||||
36
.config/nvim/snippets/typescript.snippets
Normal file
36
.config/nvim/snippets/typescript.snippets
Normal file
@@ -0,0 +1,36 @@
|
|||||||
|
snippet xhandler Create initial handler for nuxt
|
||||||
|
import { defineEventHandler } from 'h3'
|
||||||
|
import { useRuntimeConfig } from 'nitropack/runtime'
|
||||||
|
|
||||||
|
export default defineEventHandler((event) => {
|
||||||
|
${0}
|
||||||
|
})
|
||||||
|
|
||||||
|
snippet xrunconf Load runtime config in nuxt/nitro
|
||||||
|
const ${1:config} = useRuntimeConfig()
|
||||||
|
${0}
|
||||||
|
|
||||||
|
snippet xref Add ref
|
||||||
|
const ${1} = ref${3}(${2:''})
|
||||||
|
${0}
|
||||||
|
|
||||||
|
snippet xcom Add computed
|
||||||
|
const ${1} = computed(() => ${2})
|
||||||
|
${0}
|
||||||
|
|
||||||
|
snippet xfun Add a function in a const
|
||||||
|
const ${1} = (${2}) => ${4:{}}
|
||||||
|
$0
|
||||||
|
|
||||||
|
snippet xstore Define a pinia store
|
||||||
|
import { defineStore } from 'pinia'
|
||||||
|
|
||||||
|
export const use${2} = defineStore('$1', () => {
|
||||||
|
$0
|
||||||
|
return {
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
snippet xufetch Add a useFetch call
|
||||||
|
const { data: ${1:data} } = useFetch('${2}', {${3}})
|
||||||
|
$0
|
||||||
44
.config/nvim/snippets/vue.snippets
Normal file
44
.config/nvim/snippets/vue.snippets
Normal file
@@ -0,0 +1,44 @@
|
|||||||
|
snippet xscript Create initial skeleton
|
||||||
|
<script setup lang="ts">
|
||||||
|
${1}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<template>
|
||||||
|
${2:<div>$3</div>}
|
||||||
|
</template>
|
||||||
|
|
||||||
|
snippet xpagemeta Add page meta
|
||||||
|
definePageMeta({ ${0} })
|
||||||
|
|
||||||
|
snippet xulocalepath Add localePath
|
||||||
|
const ${1:localePath} = useLocalePath()
|
||||||
|
|
||||||
|
snippet xlocalepath get locale localePath
|
||||||
|
localePath('${1}')
|
||||||
|
|
||||||
|
snippet xlp get locale localePath
|
||||||
|
localePath('${1}')
|
||||||
|
|
||||||
|
snippet xui18n Add useI18n
|
||||||
|
const { t${1} } = useI18n()
|
||||||
|
$0
|
||||||
|
|
||||||
|
snippet xuroute Add useRoute
|
||||||
|
const ${1:route} = useRoute()
|
||||||
|
$0
|
||||||
|
|
||||||
|
snippet xufetch Add a useFetch call
|
||||||
|
const { data: ${1:data} } = useFetch('${2}', {${3}})
|
||||||
|
$0
|
||||||
|
|
||||||
|
snippet xref Add ref
|
||||||
|
const ${1} = ref${3}(${2:''})
|
||||||
|
${0}
|
||||||
|
|
||||||
|
snippet xcom Add computed
|
||||||
|
const ${1} = computed(() => ${2})
|
||||||
|
${0}
|
||||||
|
|
||||||
|
snippet xfun Add a function in a const
|
||||||
|
const ${1} = (${2}) => ${4:{}}
|
||||||
|
$0
|
||||||
251
.vimrc
251
.vimrc
@@ -1,251 +0,0 @@
|
|||||||
" Start: Manage plugins
|
|
||||||
set nocompatible
|
|
||||||
filetype off
|
|
||||||
set runtimepath+=~/.vim/bundle/Vundle.vim
|
|
||||||
call vundle#begin()
|
|
||||||
" Plugin-Manager
|
|
||||||
Plugin 'git@github.com:VundleVim/Vundle.vim'
|
|
||||||
|
|
||||||
" A wiki within vim
|
|
||||||
Plugin 'git@github.com:vimwiki/vimwiki'
|
|
||||||
|
|
||||||
" A navigable visualization of vim's file-history
|
|
||||||
Plugin 'git@github.com:mbbill/undotree'
|
|
||||||
|
|
||||||
" A handy file-browser for vim
|
|
||||||
Plugin 'git@github.com:scrooloose/nerdtree'
|
|
||||||
|
|
||||||
" Utilities which are required by vim-snipmate
|
|
||||||
Plugin 'git@github.com:MarcWeber/vim-addon-mw-utils'
|
|
||||||
" Utilities which are required by vim-snipmate
|
|
||||||
Plugin 'git@github.com:tomtom/tlib_vim'
|
|
||||||
" Manage snippets as short cuts for vim
|
|
||||||
Plugin 'git@github.com:garbas/vim-snipmate'
|
|
||||||
|
|
||||||
" Add support for typecript-syntax
|
|
||||||
Plugin 'git@github.com:leafgarland/typescript-vim'
|
|
||||||
|
|
||||||
" Improve foldings on yaml-files (These are otherwise really unconvenient in vim)
|
|
||||||
Plugin 'git@github.com:pedrohdz/vim-yaml-folds'
|
|
||||||
|
|
||||||
" Add git-support, especially the command :Git
|
|
||||||
Plugin 'git@github.com:tpope/vim-fugitive'
|
|
||||||
|
|
||||||
" Autoformat tables in vim
|
|
||||||
Plugin 'git@github.com:godlygeek/tabular'
|
|
||||||
|
|
||||||
" Add git-status-marker in nerdtree
|
|
||||||
Plugin 'git@github.com:Xuyuanp/nerdtree-git-plugin'
|
|
||||||
|
|
||||||
" Enable syntax-checks
|
|
||||||
Plugin 'git@github.com:vim-syntastic/syntastic'
|
|
||||||
|
|
||||||
" Add markers for changed lines
|
|
||||||
Plugin 'git@github.com:airblade/vim-gitgutter'
|
|
||||||
|
|
||||||
" A magigical search-term for pretty much everything within vim
|
|
||||||
Plugin 'git@github.com:ctrlpvim/ctrlp.vim'
|
|
||||||
|
|
||||||
" Add a bunch of support for csv-files
|
|
||||||
Plugin 'git@github.com:chrisbra/csv.vim'
|
|
||||||
|
|
||||||
" A navigable view of the tags/marks within a file
|
|
||||||
Plugin 'git@github.com:preservim/tagbar'
|
|
||||||
|
|
||||||
" Add support for js-syntax
|
|
||||||
Plugin 'git@github.com:jelera/vim-javascript-syntax'
|
|
||||||
|
|
||||||
" A 'surround' command similiar to the 'inner' commands (cs'" to change quotes)
|
|
||||||
Plugin 'git@github.com:tpope/vim-surround'
|
|
||||||
|
|
||||||
" A cool theme with good readability
|
|
||||||
Plugin 'git@github.com:lifepillar/vim-gruvbox8'
|
|
||||||
|
|
||||||
" A tool to remove every noisy output to concentrate on writing!
|
|
||||||
Plugin 'git@github.com:junegunn/goyo.vim'
|
|
||||||
|
|
||||||
" Add support for hcl (terraform, packer, etc.)
|
|
||||||
Plugin 'git@github.com:hashivim/vim-terraform'
|
|
||||||
Plugin 'git@github.com:hashivim/vim-packer'
|
|
||||||
|
|
||||||
" Add closing-tags in HTML/XML
|
|
||||||
Plugin 'git@github.com:alvan/vim-closetag.git'
|
|
||||||
|
|
||||||
" A tool to build HTML with a simplified selector-language
|
|
||||||
Plugin 'git@github.com:mattn/emmet-vim.git'
|
|
||||||
|
|
||||||
" Add a status/tabline at the bottom
|
|
||||||
Plugin 'git@github.com:vim-airline/vim-airline.git'
|
|
||||||
|
|
||||||
" A calendar-integration
|
|
||||||
Plugin 'git@github.com:mattn/calendar-vim.git'
|
|
||||||
|
|
||||||
" Papercolor
|
|
||||||
Plugin 'git@github.com:NLKNguyen/papercolor-theme.git'
|
|
||||||
|
|
||||||
call vundle#end()
|
|
||||||
" End: Manage plugins
|
|
||||||
filetype plugin on
|
|
||||||
|
|
||||||
syntax on
|
|
||||||
|
|
||||||
let mapleader = ","
|
|
||||||
|
|
||||||
let g:gruvbox_contrast_dark = 'hard'
|
|
||||||
let g:vimwiki_table_mappings = 0
|
|
||||||
let g:vimwiki_folding = 'expr'
|
|
||||||
let g:vimwiki_list = [{'path': '~/Development/nemoinho/gitea.nehrke.info/nemoinho/vimwiki/', 'auto_export': 1}]
|
|
||||||
let g:vimwiki_autowriteall = 0
|
|
||||||
let g:vimwiki_url_maxsave = 0
|
|
||||||
let g:NERDTreeGitStatusShowIgnored = 1
|
|
||||||
let NERDTreeMinimalUI = 1
|
|
||||||
let NERDTreeDirArrows = 1
|
|
||||||
let g:snipMate = { 'snippet_version' : 1 }
|
|
||||||
let g:tagbar_ctags_bin = '~/.local/opt/ctags/bin/ctags'
|
|
||||||
let g:ctrlp_custom_ignore = 'node_modules\|dist'
|
|
||||||
|
|
||||||
set bg=dark
|
|
||||||
" Settings
|
|
||||||
set listchars=tab:›\ ,trail:·,nbsp:_,extends:»,precedes:«
|
|
||||||
set list
|
|
||||||
set hlsearch
|
|
||||||
set number
|
|
||||||
set relativenumber
|
|
||||||
set nowrap
|
|
||||||
set linebreak
|
|
||||||
" Enable vim configs in the first or last lines of a file
|
|
||||||
set modeline
|
|
||||||
set modelineexpr
|
|
||||||
" Avoid an extra line at the end of the file
|
|
||||||
set nofixendofline
|
|
||||||
|
|
||||||
set tabstop=4
|
|
||||||
set shiftwidth=4
|
|
||||||
set expandtab
|
|
||||||
set backspace=indent,eol,start
|
|
||||||
|
|
||||||
" specific for MacVim set a pleasing font-size
|
|
||||||
set guifont=Menlo\ Regular:h15
|
|
||||||
|
|
||||||
highlight LineNr ctermfg=7
|
|
||||||
highlight CusrsorLineNr ctermbg=green
|
|
||||||
highlight CusrsorLine ctermbg=green
|
|
||||||
|
|
||||||
colorscheme gruvbox8
|
|
||||||
|
|
||||||
" ease CTRL-] since it's very hard to type on german keyboards
|
|
||||||
" However I can't just remap the command to the matching position since this
|
|
||||||
" is not a valid input for most unix-terminals. Therefore I just drop the
|
|
||||||
" CTRL-prefix and use the letter where the bracket would be on us keyboards.
|
|
||||||
" See: https://stackoverflow.com/a/16748339/4316528
|
|
||||||
nnoremap ä <C-]>
|
|
||||||
" <C-T> just don't work right now and that seems like a convenient keybinding
|
|
||||||
nnoremap ö <C-T>
|
|
||||||
|
|
||||||
" General utilities
|
|
||||||
nnoremap <leader>cd :cd %:p:h<CR>
|
|
||||||
nnoremap <Leader>gg :Goyo<CR>
|
|
||||||
nnoremap <Leader>l :set nu! relativenumber! wrap!<CR>
|
|
||||||
nnoremap <leader>m :make<CR>
|
|
||||||
nnoremap <Leader>q :qa!<CR>
|
|
||||||
nnoremap gv :vertical wincmd f<CR>
|
|
||||||
|
|
||||||
" Snipmate
|
|
||||||
imap <leader>l <Plug>snipMateNextOrTrigger
|
|
||||||
smap <leader>l <Plug>snipMateNextOrTrigger
|
|
||||||
|
|
||||||
" Open shell with Ctrl+d to enable a toggle between a shell and vim
|
|
||||||
nnoremap <silent> <C-d> :botright terminal ++close<CR>
|
|
||||||
inoremap <silent> <C-d> <Esc>:botright terminal ++close<CR>
|
|
||||||
" nvim uses a different terminal approach – more vim-like actually :-P
|
|
||||||
if has('nvim')
|
|
||||||
nnoremap <silent> <C-d> :botright :split term://bash<CR>:resize -100<CR>:set winheight=10 wfh<CR>i
|
|
||||||
inoremap <silent> <C-d> <Esc>:botright :split term://bash<CR>:resize -100<CR>:set winheight=10 wfh<CR>i
|
|
||||||
tnoremap <Esc> <C-\><C-n>
|
|
||||||
endif
|
|
||||||
|
|
||||||
" Handle nerdtree and other utility-windows
|
|
||||||
nnoremap <Leader>, :NERDTreeFocus<CR>
|
|
||||||
nnoremap <Leader>c :NERDTreeClose<CR>
|
|
||||||
nnoremap <Leader>n :NERDTreeToggle<CR>
|
|
||||||
nnoremap <Leader>t :TagbarToggle<CR>
|
|
||||||
nnoremap <Leader>u :UndotreeToggle<CR>
|
|
||||||
|
|
||||||
" Git
|
|
||||||
nnoremap <Leader>ga. :Git add %<CR>
|
|
||||||
nnoremap <Leader>gaa :Git add .<CR>
|
|
||||||
nnoremap <Leader>gb :Git blame<CR>
|
|
||||||
nnoremap <Leader>gc :Git commit<CR>
|
|
||||||
nnoremap <Leader>gd :Git diff<CR>
|
|
||||||
nnoremap <Leader>gl :Git lg<CR>
|
|
||||||
nnoremap <Leader>gp :Git push -u origin<CR>
|
|
||||||
nnoremap <Leader>gs :Git status<CR>
|
|
||||||
nnoremap <Leader>tw :set textwidth=72<CR>
|
|
||||||
nnoremap <Leader>go :Git pull<CR>
|
|
||||||
nnoremap <Leader>gf :set textwidth=100 colorcolumn=101 spell<CR>gqqmaggV/^#<CR>kgq`a
|
|
||||||
|
|
||||||
" Install these files to ~/.vim/spell/
|
|
||||||
" http://ftp.vim.org/vim/runtime/spell/en.utf-8.spl
|
|
||||||
" http://ftp.vim.org/vim/runtime/spell/de.utf-8.spl
|
|
||||||
nnoremap <Leader>ss :set spell!<CR>
|
|
||||||
nnoremap <Leader>sd :set spelllang=de_de<CR>
|
|
||||||
nnoremap <Leader>se :set spelllang=en_us<CR>
|
|
||||||
|
|
||||||
" Tabularize
|
|
||||||
nnoremap <Leader>t, :Tabularize /,/l1<CR>
|
|
||||||
nnoremap <Leader>tc :Tabularize /;/l1<CR>
|
|
||||||
nnoremap <Leader>tp :Tabularize /\|/l1<CR>
|
|
||||||
nnoremap <Leader>tt :Tabularize /\|/l1<CR>
|
|
||||||
|
|
||||||
" Open CtrlP faster
|
|
||||||
nnoremap <Leader>p :CtrlP<CR>
|
|
||||||
|
|
||||||
" diffs
|
|
||||||
if &diff
|
|
||||||
nnoremap <Leader>1 :diffget LOCAL<CR>
|
|
||||||
nnoremap <Leader>2 :diffget BASE<CR>
|
|
||||||
nnoremap <Leader>3 :diffget REMOTE<CR>
|
|
||||||
nnoremap <Leader>n ]c
|
|
||||||
nnoremap <Leader>p [c
|
|
||||||
nnoremap ä ]c
|
|
||||||
nnoremap ö [c
|
|
||||||
endif
|
|
||||||
|
|
||||||
augroup configgroup
|
|
||||||
autocmd!
|
|
||||||
autocmd BufRead,BufNewFile ~/.config/git/* set filetype=gitconfig
|
|
||||||
autocmd FileType gitconfig set tabstop=4 softtabstop=8 shiftwidth=0 noexpandtab
|
|
||||||
autocmd FileType terraform set tabstop=2 softtabstop=2 shiftwidth=0 expandtab foldmethod=marker foldmarker={,} foldlevel=2
|
|
||||||
autocmd FileType javascript set tabstop=2 softtabstop=2 shiftwidth=2 expandtab foldlevel=5
|
|
||||||
autocmd FileType yaml set tabstop=2 softtabstop=2 shiftwidth=2 expandtab foldlevel=4
|
|
||||||
|
|
||||||
" Close when only Nerdtree would remain
|
|
||||||
autocmd BufEnter * if (winnr("$") == 1 && exists("b:NERDTree") && b:NERDTree.isTabTree()) | q | endif
|
|
||||||
|
|
||||||
" Copy global wrap in diff (This way I can use the same behavior in diff as in normal views)
|
|
||||||
autocmd FilterWritePre * if &diff | setlocal wrap< | endif
|
|
||||||
|
|
||||||
" vimwiki
|
|
||||||
autocmd BufRead,BufNewFile diary.wiki VimwikiDiaryGenerateLinks
|
|
||||||
autocmd BufRead,BufNewFile *.wiki set wrap nonumber norelativenumber
|
|
||||||
"autocmd BufRead,BufNewFile *.wiki Goyo 80 | set wrap
|
|
||||||
autocmd FileType vimwiki set tabstop=2 softtabstop=2 shiftwidth=2 expandtab foldlevel=10
|
|
||||||
autocmd FileType vimwiki nnoremap <Leader>d :VimwikiDiaryIndex<CR>
|
|
||||||
autocmd FileType vimwiki nnoremap <Leader>to :VimwikiTOC<CR>
|
|
||||||
autocmd FileType vimwiki nnoremap <Leader>q :Goyo!<CR>:q<CR>
|
|
||||||
" On mac ctrl+space is occupied by their spotlight search...
|
|
||||||
" So I need a workaround to avoid apples stupid keyboard-thing
|
|
||||||
autocmd FileType vimwiki nnoremap <Leader><Space> :VimwikiToggleListItem<CR>j
|
|
||||||
autocmd FileType vimwiki nnoremap <Leader>m :VimwikiToggleListItem<CR>
|
|
||||||
autocmd FileType vimwiki nnoremap <A-Space> :VimwikiToggleListItem<CR>
|
|
||||||
" end of apple workarounds, I might get used to one of these...
|
|
||||||
autocmd FileType vimwiki nnoremap <silent> <Leader>x :call system('git add . && git commit -m "Auto commit" && git push')<CR>
|
|
||||||
autocmd FileType vimwiki nnoremap ZZ :Goyo!<CR>:x<CR>
|
|
||||||
" Fix broken backspace functionality on mac
|
|
||||||
if has("unix")
|
|
||||||
let s:uname = system("uname -s")
|
|
||||||
if s:uname == "Darwin"
|
|
||||||
autocmd FileType vimwiki nnoremap <C-H> <Plug>VimwikiGoBackLink
|
|
||||||
endif
|
|
||||||
endif
|
|
||||||
augroup end
|
|
||||||
Reference in New Issue
Block a user