diff options
| author | Martin Fischer <martin@push-f.com> | 2026-10-10 12:25:43 +0200 |
|---|---|---|
| committer | Martin Fischer <martin@push-f.com> | 2026-10-31 08:20:38 +0100 |
| commit | 3b40c998ad60ad7e15b4336d2127797a42d372aa (patch) | |
| tree | 536601fd462ad05030b796409069d09ff762b6a6 /user/nvim | |
| parent | 7dc8285962df04d74f23efba26a0f55a839af45d (diff) | |
tweak(workstation): use neovim instead of vim
Diffstat (limited to 'user/nvim')
| -rw-r--r-- | user/nvim/after/ftplugin/lua.lua | 4 | ||||
| -rw-r--r-- | user/nvim/after/ftplugin/markdown.lua | 5 | ||||
| -rw-r--r-- | user/nvim/after/ftplugin/nix.lua | 7 | ||||
| -rw-r--r-- | user/nvim/after/ftplugin/svelte.lua | 7 | ||||
| -rw-r--r-- | user/nvim/after/ftplugin/typescript.lua | 7 | ||||
| -rw-r--r-- | user/nvim/init.lua | 36 |
6 files changed, 66 insertions, 0 deletions
diff --git a/user/nvim/after/ftplugin/lua.lua b/user/nvim/after/ftplugin/lua.lua new file mode 100644 index 0000000..8b03725 --- /dev/null +++ b/user/nvim/after/ftplugin/lua.lua @@ -0,0 +1,4 @@ +vim.opt_local.expandtab = true +vim.opt_local.shiftwidth = 2 +vim.opt_local.softtabstop = 2 +vim.opt_local.tabstop = 2 diff --git a/user/nvim/after/ftplugin/markdown.lua b/user/nvim/after/ftplugin/markdown.lua new file mode 100644 index 0000000..9909541 --- /dev/null +++ b/user/nvim/after/ftplugin/markdown.lua @@ -0,0 +1,5 @@ +-- Shortcut for Hugo TOML frontmatter. +vim.keymap.set('n', '<C-f>', 'i+++<CR>title = ""<CR>+++<CR><Esc>kk$i', { + buffer = true, + desc = 'Insert Hugo TOML frontmatter', +}) diff --git a/user/nvim/after/ftplugin/nix.lua b/user/nvim/after/ftplugin/nix.lua new file mode 100644 index 0000000..af99d8d --- /dev/null +++ b/user/nvim/after/ftplugin/nix.lua @@ -0,0 +1,7 @@ +vim.opt_local.expandtab = true +vim.opt_local.shiftwidth = 2 +vim.opt_local.softtabstop = 2 +vim.opt_local.tabstop = 2 + +vim.treesitter.start() +vim.bo.indentexpr = "v:lua.require'nvim-treesitter'.indentexpr()" diff --git a/user/nvim/after/ftplugin/svelte.lua b/user/nvim/after/ftplugin/svelte.lua new file mode 100644 index 0000000..af99d8d --- /dev/null +++ b/user/nvim/after/ftplugin/svelte.lua @@ -0,0 +1,7 @@ +vim.opt_local.expandtab = true +vim.opt_local.shiftwidth = 2 +vim.opt_local.softtabstop = 2 +vim.opt_local.tabstop = 2 + +vim.treesitter.start() +vim.bo.indentexpr = "v:lua.require'nvim-treesitter'.indentexpr()" diff --git a/user/nvim/after/ftplugin/typescript.lua b/user/nvim/after/ftplugin/typescript.lua new file mode 100644 index 0000000..af99d8d --- /dev/null +++ b/user/nvim/after/ftplugin/typescript.lua @@ -0,0 +1,7 @@ +vim.opt_local.expandtab = true +vim.opt_local.shiftwidth = 2 +vim.opt_local.softtabstop = 2 +vim.opt_local.tabstop = 2 + +vim.treesitter.start() +vim.bo.indentexpr = "v:lua.require'nvim-treesitter'.indentexpr()" diff --git a/user/nvim/init.lua b/user/nvim/init.lua new file mode 100644 index 0000000..7302e3d --- /dev/null +++ b/user/nvim/init.lua @@ -0,0 +1,36 @@ +-- Configure settings that apply to all filetypes. +-- Filetype-specific settings live in after/ftplugin/. + +-- Don't break words in the middle. +vim.opt.linebreak = true + +-- Use the system clipboard. +vim.opt.clipboard = "unnamedplus" + +-- Ignore case in search unless the pattern contains uppercase. +vim.opt.ignorecase = true +vim.opt.smartcase = true + +-- Color scheme +require('vscode').setup({ + -- Enable transparent background. + transparent = true, +}) +vim.cmd.colorscheme "vscode" + +-- File picker +local pick = require('mini.pick') +-- Disable icons in mini.pick (my font doesn't have them). +pick.setup({ source = { show = pick.default_show } }) +-- Reuse Neovim's popup-menu selection color for mini.pick's selected item. +vim.api.nvim_set_hl(0, 'MiniPickMatchCurrent', { link = 'PmenuSel' }) + +-- Keyboard shortcuts + +-- Clear search highlighting with Escape. +vim.keymap.set('n', '<Esc>', '<cmd>nohlsearch<CR>', { desc = 'Clear search highlight' }) + +vim.keymap.set('n', '<C-p>', function() + local tool = vim.fs.root(vim.fn.getcwd(), '.git') and 'git' or nil + pick.builtin.files({ tool = tool }) +end, { desc = 'Pick files' }) |
