Compare commits

...

27 Commits

Author SHA1 Message Date
don philipe
f6bbc705f8 Add latex to treesitter config 2025-09-23 23:14:08 +02:00
don philipe
30d3a8c29a Merge neovim settings 2025-09-04 09:20:03 +02:00
don philipe
a414890f69 Fix coloring in nvim in tmux remote sessions 2025-09-04 04:53:16 +02:00
don philipe
2df66474db Merge zsh functions 2025-09-04 04:51:08 +02:00
don philipe
3e30bb71a0 Add zsh function to list all git blobs in a repo 2025-09-02 13:23:45 +02:00
don philipe
177716cdbe Find dotfiles when they are not gitignored 2025-09-01 13:09:47 +02:00
don philipe
f8cf65bda9 Add doxx for docx file preview in ranger 2025-08-19 10:27:11 +02:00
don philipe
bea47efec4 Keymap for resetting hunk 2025-08-18 09:47:29 +02:00
don philipe
10de9c300b Add diffview nvim plugin 2025-08-14 10:39:43 +02:00
don philipe
5feff36b73 Add redmine plugin to nvim 2025-06-17 10:53:54 +02:00
don philipe
8f50d2cb75 Add TypeScript LSP 2025-06-17 10:52:04 +02:00
don philipe
b62f1697a2 Ensure autoreload works with nvim+tmux 2025-06-05 09:38:51 +02:00
don philipe
4260c7876c Add nvim plugins for showing context and indent lines 2025-06-05 00:50:19 +02:00
don philipe
ff7deb9cee Shortcut for preview hunk 2025-05-26 13:47:16 +02:00
don philipe
f84673ed16 gitsigns.nvim vertical split 2025-05-26 13:42:02 +02:00
don philipe
5bdd07c204 Pin gitsigns version 2025-05-14 13:36:26 +02:00
don philipe
469435454e Pin mason version 2025-05-14 10:17:44 +02:00
don philipe
3e51152da9 Search hidden files with telescope 2025-05-14 10:11:37 +02:00
don philipe
6a710bac5f Switch to new diff pane after gitsigns diffthis 2025-04-24 14:21:22 +02:00
don philipe
af50ddd8ea Add rounded borders for completion plugin 2025-04-23 22:04:41 +02:00
don philipe
7128760315 Add rounded borders for lazy plugin manager 2025-04-23 22:03:35 +02:00
don philipe
f078314b0d Custom nvim indents for various filetypes 2025-04-23 22:02:28 +02:00
don philipe
9803f705e4 Pin version of nvim plugins lsp and treesitter
For using named plugins with neovim < 0.10 plugin versions not above a
certain value are needed.
2025-04-08 12:50:46 +02:00
don philipe
b3d8e46003 Set LLM_KEY env var in nvim config 2025-04-02 09:17:12 +02:00
don philipe
cfafeb5c04 Find selected text via telescope 2025-03-25 11:28:12 +01:00
don philipe
33f864dea8 Merge alacritty config 2025-03-25 09:48:43 +01:00
don philipe
7b473872b4 Add tmux option for true color over ssh 2025-03-25 09:44:38 +01:00
25 changed files with 141 additions and 12 deletions

View File

@@ -11,6 +11,7 @@ size = 9
[font.normal]
family = "Jet Brains Mono Nerd Font"
#family = "Mononoki Nerd Font"
[general]
# https://github.com/alacritty/alacritty-theme

View File

@@ -1,6 +1,10 @@
require("config.remap")
require("config.set")
require("config.commands")
-- env vars used only for neovim
require("config.env")
-- configurations for various filetypes
require("config.filetypes")
-- plugin manager
require("config.lazy")
@@ -11,9 +15,13 @@ require("config.gen-private")
require("config.lsp")
require("config.mason")
require("config.treesitter")
require("config.treesitter-context")
require("config.gitsigns")
require("config.lualine")
require("config.telescope")
require("config.indentline")
require("config.redmine")
require("config.diffview")
-- for some reason this must be placed in init.lua file
-- it doesn't work in any lua/config/*.lua files

View File

@@ -24,4 +24,9 @@ cmp.setup({
vim.snippet.expand(args.body)
end,
},
-- switch on rounded borders in floating completion windows
window = {
completion = cmp.config.window.bordered(),
documentation = cmp.config.window.bordered(),
},
})

View File

@@ -0,0 +1,2 @@
require("diffview").setup({
})

View File

@@ -0,0 +1 @@
vim.env.LLM_KEY = "None"

View File

@@ -0,0 +1,23 @@
vim.api.nvim_create_autocmd('Filetype', {
pattern = {
'xml',
'html',
'xhtml',
'css',
'scss',
'javascript',
'typescript',
'lua',
'jsx',
'tsx',
'typescriptreact',
'javascriptreact',
'htmldjango'
},
command = 'setlocal shiftwidth=4 tabstop=4 expandtab'
})
vim.api.nvim_create_autocmd('Filetype', {
pattern = { 'yaml',
},
command = 'setlocal shiftwidth=2 tabstop=2 expandtab'
})

View File

@@ -1,6 +1,8 @@
require('gitsigns').setup()
local gitsigns = require('gitsigns')
vim.keymap.set('n', '<leader>gm', gitsigns.blame_line, { desc = 'Show git message for current line' })
vim.keymap.set('n', '<leader>gd', gitsigns.diffthis, { desc = 'Show diff for current line' })
vim.keymap.set('n', '<leader>gd', ':Gitsigns diffthis ~ vertical=true<CR>:wincmd w<CR>', { desc = 'Show diff for current line' })
vim.keymap.set('n', '<leader>gr', gitsigns.reset_hunk, { desc = 'Reset current hunk' })
vim.keymap.set('n', '<leader>h', gitsigns.next_hunk, { desc = 'Move to next hunk' })
vim.keymap.set('n', '<leader>H', gitsigns.prev_hunk, { desc = 'Move to previous hunk' })
vim.keymap.set('n', '<leader>ph', gitsigns.preview_hunk, { desc = 'Preview hunk in popup' })

View File

@@ -0,0 +1,3 @@
require'indentmini'.setup()
vim.cmd.highlight('IndentLine guifg=#444444')
vim.cmd.highlight('IndentLineCurrent guifg=#557755')

View File

@@ -33,6 +33,9 @@ require("lazy").setup({
install = { colorscheme = { "habamax" } },
-- automatically check for plugin updates
checker = { enabled = true },
ui = {
border = "rounded",
},
})
-- Open lazy menu with :Lazy check

View File

@@ -11,6 +11,8 @@ lspconfig_defaults.capabilities = vim.tbl_deep_extend(
require('cmp_nvim_lsp').default_capabilities()
)
require'lspconfig'.ts_ls.setup{}
-- This is where you enable features that only work
-- if there is a language server active in the file
vim.api.nvim_create_autocmd('LspAttach', {

View File

@@ -11,3 +11,8 @@ vim.opt.incsearch = true
vim.opt.signcolumn = "yes"
vim.o.termguicolors = true
vim.diagnostic.config({
virtual_text = true,
})

View File

@@ -4,12 +4,29 @@ vim.keymap.set('n', '<leader>fg', builtin.live_grep, { desc = 'Telescope live gr
vim.keymap.set('n', '<leader>fb', builtin.buffers, { desc = 'Telescope buffers' })
vim.keymap.set('n', '<leader>fh', builtin.help_tags, { desc = 'Telescope help tags' })
vim.keymap.set('n', '<leader>ft', builtin.treesitter, { desc = 'Telescope treesitter picker' })
-- find selected text in visual mode with Ctrl-f via telescope:
vim.keymap.set('v', '<C-f>', 'y<ESC>:Telescope live_grep default_text=<C-r>0<CR>', default_opts)
-- grep hidden files as well
local telescopeConfig = require("telescope.config")
local vimgrep_arguments = { unpack(telescopeConfig.values.vimgrep_arguments) }
-- I want to search in hidden/dot files.
table.insert(vimgrep_arguments, "--hidden")
-- I don't want to search in the `.git` directory.
table.insert(vimgrep_arguments, "--glob")
table.insert(vimgrep_arguments, "!**/.git/*")
require('telescope').setup({
defaults = {
layout_strategy = 'vertical',
layout_config = {
vertical = { width = 0.95 }
defaults = {
vimgrep_arguments = vimgrep_arguments,
layout_strategy = 'vertical',
layout_config = {
vertical = { width = 0.95 }
},
},
pickers = {
find_files = {
find_command = { "rg", "--files", "--hidden", "--glob", "!**/.git/*" },
},
},
},
})

View File

@@ -0,0 +1,3 @@
require'treesitter-context'.setup{
enable = true,
}

View File

@@ -1,6 +1,6 @@
require'nvim-treesitter.configs'.setup {
-- A list of parser names, or "all" (the listed parsers MUST always be installed)
ensure_installed = { "c", "lua", "vim", "vimdoc", "query", "markdown", "markdown_inline", "python", "javascript", "css", "html", "yaml", "java", "bash", "csv", "dockerfile", "htmldjango", "json", "nginx" },
ensure_installed = { "c", "lua", "vim", "vimdoc", "query", "markdown", "markdown_inline", "python", "javascript", "css", "html", "yaml", "java", "bash", "csv", "dockerfile", "htmldjango", "json", "nginx", "latex" },
-- Install parsers synchronously (only applied to `ensure_installed`)
sync_install = false,
@@ -34,4 +34,9 @@ require'nvim-treesitter.configs'.setup {
-- Instead of true it can also be a list of languages
additional_vim_regex_highlighting = false,
},
-- indent with treesitter is currently experimental, just mark text and hit "="
indent = {
enable = true,
},
}

View File

@@ -0,0 +1,3 @@
return {
"sindrets/diffview.nvim"
}

View File

@@ -1,3 +1,3 @@
return {
{'lewis6991/gitsigns.nvim'}
{'lewis6991/gitsigns.nvim', version='^1.0.2'}
}

View File

@@ -0,0 +1,3 @@
return {
"nvimdev/indentmini.nvim",
}

View File

@@ -1,5 +1,5 @@
return {
{'neovim/nvim-lspconfig'},
{'neovim/nvim-lspconfig', tag = 'v1.7.0'}, -- pin to a version thats compatible with nvim < 0.10
{'hrsh7th/cmp-nvim-lsp'},
{'hrsh7th/nvim-cmp'},
}

View File

@@ -1,6 +1,7 @@
return {
-- pin version due to https://github.com/mason-org/mason.nvim/issues/1929
-- mason for downloading language servers
{'williamboman/mason.nvim'},
{'williamboman/mason.nvim', version = "^1.0.0"},
-- mason-lspconfig to configure auto setup of language servers
{'williamboman/mason-lspconfig.nvim'},
{'williamboman/mason-lspconfig.nvim', version = "^1.0.0"},
}

View File

@@ -0,0 +1,6 @@
return {
"sgross-emlix/angerona.nvim",
dependencies = {
"nvim-lua/plenary.nvim",
},
}

View File

@@ -0,0 +1,4 @@
return {
{'nvim-treesitter/nvim-treesitter-context',
},
}

View File

@@ -1,5 +1,6 @@
return {
{'nvim-treesitter/nvim-treesitter'}
{'nvim-treesitter/nvim-treesitter',
tag = 'v0.9.3'}, -- pin to a version that works with nvim < 0.10
-- configure parsers via config/treesitter.lua
-- update parsers with :TSUpdate
}

View File

@@ -87,6 +87,12 @@ handle_extension() {
pandoc -s -t markdown -- "${FILE_PATH}" && exit 5
exit 1;;
## DOCX
docx)
## Uses: https://github.com/bgreenwell/doxx
doxx "${FILE_PATH}" && exit 5
exit 1;;
## XLSX
xlsx)
## Preview as csv conversion

View File

@@ -3,6 +3,11 @@ set -g default-shell /usr/bin/zsh
set-window-option -g window-active-style bg=terminal
# grayed background for inactive panes
set-window-option -g window-style bg="#32302f"
# ensure "autoread" works in nvim (auto reload files when changed)
set-option -g focus-events on
# https://gist.github.com/andersevenrud/015e61af2fd264371032763d4ed965b6
set -g default-terminal "tmux-256color"
set -ag terminal-overrides ",xterm-256color:RGB"
# List of plugins

View File

@@ -59,6 +59,26 @@ m4a2mp3()
done
}
# Show all blob objects in repo sorted from smalles to largest
# https://stackoverflow.com/a/42544963
git-blobs()
{
git rev-list --objects --all --missing=print |
git cat-file --batch-check='%(objecttype) %(objectname) %(objectsize) %(rest)' |
sed -n 's/^blob //p' |
sort --numeric-sort --key=2 |
cut -c 1-12,41- |
$(command -v gnumfmt || echo numfmt) --field=2 --to=iec-i --suffix=B --padding=7 --round=nearest
}
sshs()
{
tmprc=$(ssh $1 "mktemp --directory")
scp -q $HOME/.zshrc $1:$tmprc
ssh -t $1 "export ZDOTDIR=${tmprc}; exec zsh"
ssh $1 "rm -rf ${tmprc}"
}
# show the current mode:
#PR_VIMODE="#"
#function zle-keymap-select