Initial commit
This commit is contained in:
commit
c1f1491d6b
1
.gitignore
vendored
Normal file
1
.gitignore
vendored
Normal file
@ -0,0 +1 @@
|
||||
.DS_Store
|
7
README.md
Normal file
7
README.md
Normal file
@ -0,0 +1,7 @@
|
||||
# Dotfiles
|
||||
|
||||
## Install
|
||||
|
||||
```sh
|
||||
stow --verbose --restow --target ~ nvim
|
||||
```
|
5
nvim/.config/nvim/init.lua
Normal file
5
nvim/.config/nvim/init.lua
Normal file
@ -0,0 +1,5 @@
|
||||
require 'config.options'
|
||||
require 'config.keymaps'
|
||||
require 'config.lazy'
|
||||
require 'config.autocommands'
|
||||
require 'config.colorscheme'
|
16
nvim/.config/nvim/lazy-lock.json
Normal file
16
nvim/.config/nvim/lazy-lock.json
Normal file
@ -0,0 +1,16 @@
|
||||
{
|
||||
"LuaSnip": { "branch": "master", "commit": "03c8e67eb7293c404845b3982db895d59c0d1538" },
|
||||
"barbar.nvim": { "branch": "master", "commit": "53b5a2f34b68875898f0531032fbf090e3952ad7" },
|
||||
"catppuccin": { "branch": "main", "commit": "4fd72a9ab64b393c2c22b168508fd244877fec96" },
|
||||
"friendly-snippets": { "branch": "main", "commit": "00ebcaa159e817150bd83bfe2d51fa3b3377d5c4" },
|
||||
"gitsigns.nvim": { "branch": "main", "commit": "80214a857ce512cc64964abddc1d8eb5a3e28396" },
|
||||
"lazy.nvim": { "branch": "main", "commit": "077102c5bfc578693f12377846d427f49bc50076" },
|
||||
"lualine.nvim": { "branch": "master", "commit": "b431d228b7bbcdaea818bdc3e25b8cdbe861f056" },
|
||||
"neoscroll.nvim": { "branch": "master", "commit": "532dcc8cea4287c4cad6bb77532989a8217cfc7b" },
|
||||
"nvim-surround": { "branch": "main", "commit": "ec2dc7671067e0086cdf29c2f5df2dd909d5f71f" },
|
||||
"nvim-tree.lua": { "branch": "master", "commit": "ad0b95dee55955817af635fa121f6e2486b10583" },
|
||||
"nvim-treesitter": { "branch": "master", "commit": "7499f7379459db3b31c75cf5cec45f785be6e2c7" },
|
||||
"nvim-web-devicons": { "branch": "master", "commit": "3722e3d1fb5fe1896a104eb489e8f8651260b520" },
|
||||
"plenary.nvim": { "branch": "master", "commit": "ec289423a1693aeae6cd0d503bac2856af74edaa" },
|
||||
"telescope.nvim": { "branch": "master", "commit": "d90956833d7c27e73c621a61f20b29fdb7122709" }
|
||||
}
|
18
nvim/.config/nvim/lua/config/autocommands.lua
Normal file
18
nvim/.config/nvim/lua/config/autocommands.lua
Normal file
@ -0,0 +1,18 @@
|
||||
local git_commit_message_group = vim.api.nvim_create_augroup('gitCommitMessage', { clear = true })
|
||||
local plaintext = vim.api.nvim_create_augroup('plaintext', { clear = true })
|
||||
local markdown = vim.api.nvim_create_augroup('markdown', { clear = true })
|
||||
local yank_group = vim.api.nvim_create_augroup('HighlightYank', {})
|
||||
|
||||
vim.api.nvim_create_autocmd({'Filetype'}, {pattern = 'gitcommit', group = git_commit_message_group, command = 'setlocal spell textwidth=72 colorcolumn=51,73'} )
|
||||
vim.api.nvim_create_autocmd({'Filetype'}, {pattern = 'text', group = plaintext, command = 'setlocal spell foldmethod=marker foldcolumn=2'} )
|
||||
vim.api.nvim_create_autocmd({'Filetype'}, {pattern = 'markdown', group = markdown, command = 'setlocal spell conceallevel=2'} )
|
||||
vim.api.nvim_create_autocmd('TextYankPost', {
|
||||
group = yank_group,
|
||||
pattern = '*',
|
||||
callback = function()
|
||||
vim.highlight.on_yank({
|
||||
higroup = 'IncSearch',
|
||||
timeout = 500,
|
||||
})
|
||||
end,
|
||||
})
|
4
nvim/.config/nvim/lua/config/colorscheme.lua
Normal file
4
nvim/.config/nvim/lua/config/colorscheme.lua
Normal file
@ -0,0 +1,4 @@
|
||||
vim.opt.background = 'dark'
|
||||
vim.opt.termguicolors = true
|
||||
|
||||
vim.cmd.colorscheme 'catppuccin-mocha'
|
71
nvim/.config/nvim/lua/config/keymaps.lua
Normal file
71
nvim/.config/nvim/lua/config/keymaps.lua
Normal file
@ -0,0 +1,71 @@
|
||||
-- ============================================================================
|
||||
-- Major Maps *major-maps* {{{1
|
||||
vim.g.mapleader = ' '
|
||||
vim.g.maplocalleader = ' '
|
||||
|
||||
-- }}}1
|
||||
local silent = { silent = true, noremap = true }
|
||||
|
||||
-- Telescope
|
||||
--local builtin = require('telescope.builtin')
|
||||
--vim.keymap.set('n', '<leader>ff', builtin.find_files, silent)
|
||||
--vim.keymap.set('n', '<leader>fg', builtin.live_grep, silent)
|
||||
--vim.keymap.set('n', '<leader>fb', builtin.buffers, silent)
|
||||
--vim.keymap.set('n', '<leader>fh', builtin.help_tags, silent)
|
||||
|
||||
-- shortcuts to change buffers the same way as tabs
|
||||
-- vim.keymap.set('n', 'gb', ':bn<CR>', silent)
|
||||
-- vim.keymap.set('n', 'gB', ':bp<CR>', silent)
|
||||
|
||||
vim.api.nvim_set_keymap("n", "<C-h>", ":NvimTreeToggle<cr>", {silent = true, noremap = true})
|
||||
|
||||
-- Fast save
|
||||
vim.keymap.set('n', '<leader>w', ':w!<cr>', silent)
|
||||
|
||||
vim.keymap.set('n', '<leader>n', ':NvimTreeToggle<cr>', silent)
|
||||
|
||||
vim.keymap.set('n', '<leader><space>', ':noh<cr>', silent)
|
||||
|
||||
-- Remap, because % is mapped to matchit
|
||||
vim.keymap.set({ 'n', 'v' }, '<tab>', '%', { silent = true, remap = true })
|
||||
|
||||
vim.keymap.set('n', '<leader>s', ':%s//<left>', silent)
|
||||
vim.keymap.set('v', '<leader>s', ':s//<left>', silent)
|
||||
|
||||
-- use enter/backspace to add/remove lines in normal mode
|
||||
-- New line without entering insert mode
|
||||
vim.keymap.set('n', '<CR>', 'o<Esc>k', silent)
|
||||
vim.keymap.set('n', '<S-CR>', 'ko<Esc>j', silent)
|
||||
vim.keymap.set('n', '<Backspace>', 'ddk', silent)
|
||||
|
||||
-- Do not fill the yank register with single chars
|
||||
vim.keymap.set('n', 'x', '"_x', silent)
|
||||
vim.keymap.set('n', 'X', '"_X', silent)
|
||||
|
||||
vim.keymap.set("n", "J", "mzJ`z")
|
||||
|
||||
vim.keymap.set("v", "J", ":m '>+1<CR>gv=gv")
|
||||
vim.keymap.set("v", "K", ":m '<-2<CR>gv=gv")
|
||||
|
||||
vim.keymap.set('n', '<leader>u', ':UndotreeToggle<CR>', silent)
|
||||
|
||||
vim.keymap.set('n', '<A-,>', '<Cmd>BufferPrevious<CR>', silent)
|
||||
vim.keymap.set('n', '<A-.>', '<Cmd>BufferNext<CR>', silent)
|
||||
|
||||
vim.keymap.set('n', '<A-<>', '<Cmd>BufferMovePrevious<CR>', silent)
|
||||
vim.keymap.set('n', '<A->>', '<Cmd>BufferMoveNext<CR>', silent)
|
||||
|
||||
vim.keymap.set('n', '<A-1>', '<Cmd>BufferGoto 1<CR>', silent)
|
||||
vim.keymap.set('n', '<A-2>', '<Cmd>BufferGoto 2<CR>', silent)
|
||||
vim.keymap.set('n', '<A-3>', '<Cmd>BufferGoto 3<CR>', silent)
|
||||
vim.keymap.set('n', '<A-4>', '<Cmd>BufferGoto 4<CR>', silent)
|
||||
vim.keymap.set('n', '<A-5>', '<Cmd>BufferGoto 5<CR>', silent)
|
||||
vim.keymap.set('n', '<A-6>', '<Cmd>BufferGoto 6<CR>', silent)
|
||||
vim.keymap.set('n', '<A-7>', '<Cmd>BufferGoto 7<CR>', silent)
|
||||
vim.keymap.set('n', '<A-8>', '<Cmd>BufferGoto 8<CR>', silent)
|
||||
vim.keymap.set('n', '<A-9>', '<Cmd>BufferGoto 9<CR>', silent)
|
||||
vim.keymap.set('n', '<A-0>', '<Cmd>BufferLast<CR>', silent)
|
||||
|
||||
vim.keymap.set('n', '<A-p>', '<Cmd>BufferPin<CR>', silent)
|
||||
|
||||
vim.keymap.set('n', '<A-c>', '<Cmd>BufferClose<CR>', silent)
|
14
nvim/.config/nvim/lua/config/lazy.lua
Normal file
14
nvim/.config/nvim/lua/config/lazy.lua
Normal file
@ -0,0 +1,14 @@
|
||||
local lazypath = vim.fn.stdpath('data') .. '/lazy/lazy.nvim'
|
||||
if not vim.loop.fs_stat(lazypath) then
|
||||
vim.fn.system({
|
||||
'git',
|
||||
'clone',
|
||||
'--filter=blob:none',
|
||||
'https://github.com/folke/lazy.nvim.git',
|
||||
'--branch=stable', -- latest stable release
|
||||
lazypath,
|
||||
})
|
||||
end
|
||||
vim.opt.rtp:prepend(lazypath)
|
||||
|
||||
require('lazy').setup('plugins')
|
67
nvim/.config/nvim/lua/config/options.lua
Normal file
67
nvim/.config/nvim/lua/config/options.lua
Normal file
@ -0,0 +1,67 @@
|
||||
-- Do not load netrw
|
||||
vim.g.loaded_netrw = 1
|
||||
vim.g.loaded_netrwPlugin = 1
|
||||
|
||||
vim.opt.guicursor = ''
|
||||
|
||||
vim.opt.shiftwidth = 4
|
||||
vim.opt.tabstop = 4
|
||||
vim.opt.softtabstop = 4
|
||||
vim.opt.expandtab = true
|
||||
|
||||
vim.opt.smartindent = true
|
||||
|
||||
vim.opt.number = true
|
||||
vim.opt.relativenumber = true
|
||||
|
||||
vim.opt.wrap = true
|
||||
vim.opt.linebreak = true
|
||||
-- vim.opt.textwidth=79
|
||||
vim.opt.showbreak='↪'
|
||||
vim.opt.colorcolumn= {80, 120}
|
||||
|
||||
vim.opt.backup = false
|
||||
vim.opt.writebackup = true
|
||||
vim.opt.swapfile = true
|
||||
vim.opt.undofile = true
|
||||
|
||||
vim.opt.wildmode = 'longest,full'
|
||||
vim.opt.wildignorecase = true
|
||||
vim.opt.wildignore:append({ '*.o', '*~', '*.pyc' })
|
||||
vim.opt.wildignore:append('.git')
|
||||
vim.opt.wildignore:append({ '*.jpg', '*.jpeg', '*.png', '*.gif' })
|
||||
|
||||
vim.opt.spelllang = { 'de_20', 'en_us', 'cjk' }
|
||||
|
||||
vim.opt.updatetime = 50
|
||||
|
||||
vim.opt.list = true
|
||||
vim.opt.listchars = { tab = '»·', eol = '¬', extends = '›', precedes = '‹', nbsp = '␣', trail = '·'}
|
||||
|
||||
vim.opt.matchpairs:append({'<:>', '「:」', '『:』', '【:】', '“:”', '‘:’', '《:》'})
|
||||
|
||||
vim.opt.clipboard:append('unnamedplus')
|
||||
vim.opt.showmode = false
|
||||
vim.opt.cmdheight = 1
|
||||
vim.opt.fileformat = 'unix'
|
||||
vim.opt.modelines = 1
|
||||
vim.opt.ignorecase = true
|
||||
vim.opt.smartcase = true
|
||||
vim.opt.wrapscan = true
|
||||
vim.opt.gdefault = true
|
||||
vim.opt.foldenable = true
|
||||
vim.opt.foldlevel = 99
|
||||
vim.opt.foldmethod = 'expr'
|
||||
vim.opt.foldexpr = 'nvim_treesitter#foldexpr()'
|
||||
|
||||
vim.opt.scrolloff = 0
|
||||
vim.opt.shiftround = true
|
||||
vim.opt.showmatch = true
|
||||
vim.opt.matchtime = 3
|
||||
vim.opt.cursorline = true
|
||||
vim.opt.splitbelow = true
|
||||
vim.opt.splitright = true
|
||||
vim.opt.title = true
|
||||
vim.opt.lazyredraw = true
|
||||
vim.opt.diffopt:append('vertical')
|
||||
vim.opt.iskeyword:append('-')
|
14
nvim/.config/nvim/lua/plugins/barbar.lua
Normal file
14
nvim/.config/nvim/lua/plugins/barbar.lua
Normal file
@ -0,0 +1,14 @@
|
||||
return {
|
||||
'romgrk/barbar.nvim',
|
||||
dependencies = {
|
||||
'lewis6991/gitsigns.nvim', -- OPTIONAL: for git status
|
||||
'nvim-tree/nvim-web-devicons', -- OPTIONAL: for file icons
|
||||
},
|
||||
init = function() vim.g.barbar_auto_setup = false end,
|
||||
opts = {
|
||||
sidebar_filetypes = {
|
||||
NvimTree = true,
|
||||
},
|
||||
},
|
||||
version = '^1.0.0', -- optional: only update when a new 1.x version is released
|
||||
}
|
8
nvim/.config/nvim/lua/plugins/colorschemes.lua
Normal file
8
nvim/.config/nvim/lua/plugins/colorschemes.lua
Normal file
@ -0,0 +1,8 @@
|
||||
return {
|
||||
{
|
||||
'catppuccin/nvim',
|
||||
lazy = false,
|
||||
priority = 1000,
|
||||
name = 'catppuccin',
|
||||
},
|
||||
}
|
12
nvim/.config/nvim/lua/plugins/lualine.lua
Normal file
12
nvim/.config/nvim/lua/plugins/lualine.lua
Normal file
@ -0,0 +1,12 @@
|
||||
return {
|
||||
'nvim-lualine/lualine.nvim',
|
||||
dependencies = { 'nvim-tree/nvim-web-devicons' },
|
||||
config = function ()
|
||||
require('lualine').setup {
|
||||
options = {
|
||||
icons_enabled = true,
|
||||
theme = 'catppuccin',
|
||||
}
|
||||
}
|
||||
end
|
||||
}
|
21
nvim/.config/nvim/lua/plugins/luasnip.lua
Normal file
21
nvim/.config/nvim/lua/plugins/luasnip.lua
Normal file
@ -0,0 +1,21 @@
|
||||
return {
|
||||
{
|
||||
"L3MON4D3/LuaSnip",
|
||||
version = "v2.*",
|
||||
build = "make install_jsregexp",
|
||||
dependencies = { "rafamadriz/friendly-snippets" },
|
||||
config = function ()
|
||||
require("luasnip.loaders.from_vscode").lazy_load()
|
||||
local ls = require("luasnip")
|
||||
vim.keymap.set({"i", "s"}, "<C-K>",
|
||||
function()
|
||||
if ls.expand_or_jumpable() then
|
||||
ls.expand_or_jump()
|
||||
end
|
||||
end,
|
||||
{silent = true})
|
||||
vim.keymap.set({"i", "s"}, "<C-L>", function() ls.jump( 1) end, {silent = true})
|
||||
vim.keymap.set({"i", "s"}, "<C-J>", function() ls.jump(-1) end, {silent = true})
|
||||
end
|
||||
}
|
||||
}
|
6
nvim/.config/nvim/lua/plugins/neoscroll.lua
Normal file
6
nvim/.config/nvim/lua/plugins/neoscroll.lua
Normal file
@ -0,0 +1,6 @@
|
||||
return {
|
||||
'karb94/neoscroll.nvim',
|
||||
config = function ()
|
||||
require('neoscroll').setup {}
|
||||
end
|
||||
}
|
10
nvim/.config/nvim/lua/plugins/nvim-surround.lua
Normal file
10
nvim/.config/nvim/lua/plugins/nvim-surround.lua
Normal file
@ -0,0 +1,10 @@
|
||||
return {
|
||||
"kylechui/nvim-surround",
|
||||
version = "*", -- Use for stability; omit to use `main` branch for the latest features
|
||||
event = "VeryLazy",
|
||||
config = function()
|
||||
require("nvim-surround").setup({
|
||||
-- Configuration here, or leave empty to use defaults
|
||||
})
|
||||
end
|
||||
}
|
11
nvim/.config/nvim/lua/plugins/nvim-tree.lua
Normal file
11
nvim/.config/nvim/lua/plugins/nvim-tree.lua
Normal file
@ -0,0 +1,11 @@
|
||||
return {
|
||||
"nvim-tree/nvim-tree.lua",
|
||||
version = "*",
|
||||
lazy = false,
|
||||
dependencies = {
|
||||
"nvim-tree/nvim-web-devicons",
|
||||
},
|
||||
config = function()
|
||||
require("nvim-tree").setup {}
|
||||
end,
|
||||
}
|
5
nvim/.config/nvim/lua/plugins/telescope.lua
Normal file
5
nvim/.config/nvim/lua/plugins/telescope.lua
Normal file
@ -0,0 +1,5 @@
|
||||
return {
|
||||
'nvim-telescope/telescope.nvim',
|
||||
tag = '0.1.5',
|
||||
dependencies = { 'nvim-lua/plenary.nvim' }
|
||||
}
|
17
nvim/.config/nvim/lua/plugins/treesitter.lua
Normal file
17
nvim/.config/nvim/lua/plugins/treesitter.lua
Normal file
@ -0,0 +1,17 @@
|
||||
return {
|
||||
"nvim-treesitter/nvim-treesitter",
|
||||
build = ":TSUpdate",
|
||||
config = function ()
|
||||
local configs = require("nvim-treesitter.configs")
|
||||
|
||||
configs.setup({
|
||||
ensure_installed = { "lua", "vim", "vimdoc", "javascript", "json", "yaml", "markdown", "dockerfile", "typescript", "markdown_inline", "sql", "html", "css", "gitcommit", "git_config", "fish", "diff", "python" },
|
||||
sync_install = false,
|
||||
highlight = {
|
||||
enable = true,
|
||||
additional_vim_regex_highlighting = false
|
||||
},
|
||||
indent = { enable = true },
|
||||
})
|
||||
end
|
||||
}
|
2
nvim/.config/nvim/spell/de.utf-8.add
Normal file
2
nvim/.config/nvim/spell/de.utf-8.add
Normal file
@ -0,0 +1,2 @@
|
||||
JIRA
|
||||
analytics
|
BIN
nvim/.config/nvim/spell/de.utf-8.add.spl
Normal file
BIN
nvim/.config/nvim/spell/de.utf-8.add.spl
Normal file
Binary file not shown.
Loading…
Reference in New Issue
Block a user