1
0
Fork 0
mirror of https://github.com/pnx/dotfiles synced 2026-06-17 11:30:02 +02:00

some nvim touching

This commit is contained in:
Henrik Hautakoski 2024-04-03 21:02:20 +02:00
parent 6dd8f632ad
commit f910f44191
29 changed files with 467 additions and 233 deletions

View file

@ -2,12 +2,23 @@ return {
prompt = '',
current = ' ',
selected = '',
close = '',
close = '󰅖',
pinned = '',
tree = {
node = '',
nodelast = '',
},
files = {
text = "",
symlink = "",
},
folder = {
closed = "",
open = "",
empty = "󰜌",
empty = "",
empty_open = "",
symlink = "",
symlink_open = "",
},
diff = {
added = '',
@ -15,8 +26,8 @@ return {
removed = '',
},
diff_gutter = {
add = '',
change = '',
add = '',
change = '',
delete = '',
untracked = '+'
},
@ -24,14 +35,14 @@ return {
-- Change type
added = "",
modified = "",
deleted = "",
renamed = "󰁕",
deleted = "",
renamed = "",
-- Status type
untracked = "",
ignored = "",
untracked = "",
ignored = "",
unstaged = "",
staged = "",
conflict = "",
staged = "",
conflict = "",
},
diagnostics = {
error = '',

View file

@ -50,6 +50,11 @@ map("n", "<leader>rw", [[:%s/\<<C-r><C-w>\>/<C-r><C-w>/gI<Left><Left><Left>]], {
desc = "search+replace word under cursor"
})
map({"x"}, "<leader>hx", [[:s/\(\x\{2\}\)/0x\1,/g<cr>]], { desc = "Format hex"})
map({"x"}, "<leader>ha", [[:s/0x\(\x\{1\}\X\)/0x0\1/g<cr>]], { desc = "Format hex more"})
map({"x"}, "<leader>hn", [[:s/\(\(0x\x\{1,2\}, \)\{8\}\)/\1\r/g<cr>]], { desc = "Format hex with 8 bytes per row"})
map("n", "Q", "<nop>")
-- diagnostics

View file

@ -0,0 +1,36 @@
local icons = require('config.icons')
return function ()
local highlightfunc = require("catppuccin.groups.integrations.bufferline")
return {
highlights = highlightfunc.get(),
options = {
mode = "buffers",
themable = true,
buffer_close_icon = icons.close,
close_icon = icons.close,
modified_icon = icons.modified_icon,
diagnostics = false,
enforce_regular_tabs = true,
indicator = {
style = 'underline',
},
close_command = function (bufnum)
vim.cmd("bprev")
vim.api.nvim_buf_delete(bufnum, {})
end,
hover = {
enabled = true,
delay = 200,
reveal = {'close'}
},
offsets = {
{
filetype = "neo-tree",
text = "File Explorer",
text_align = "left"
}
},
}
}
end

View file

@ -3,7 +3,14 @@ return {
color_overrides = {
mocha = {
base = '#0e1019',
mantle = '#131521',
mantle = '#0D0F17',
crust = '#0C0D14',
surface0 = '#131521',
surface1 = '#343959',
surface2 = '#41476F',
overlay0 = '#3F4256',
overlay1 = '#5B5F7C',
overlay2 = '#767BA0',
text = '#eceef4',
}
},
@ -12,21 +19,29 @@ return {
highlight_overrides = {
mocha = function(colors)
return {
CursorLine = { bg = colors.mantle },
NormalFloat = { bg = colors.crust },
FloatBorder = { fg = colors.crust, bg = colors.crust },
WinSeparator = { fg = colors.surface0 },
NoiceMini = { bg = colors.crust },
-- indent lines
IblScope = { fg = colors.overlay2 },
IblScope = { fg = colors.overlay1 },
BufferCurrent = { fg = colors.text, bg = colors.base },
BufferCurrentMod = { fg = colors.yellow, bg = colors.base },
BufferCurrentADDED = { fg = colors.green, bg = colors.base },
BufferCurrentCHANGED = { fg = colors.yellow, bg = colors.base },
BufferCurrentDELETED = { fg = colors.red, bg = colors.base },
-- LSP
LspReferenceText = { bg = colors.surface0 },
LspReferenceRead = { link = "LspReferenceText" },
LspReferenceWrite = { link = "LspReferenceText" },
-- LspReferenceText = { bg = colors.surface0 },
-- LspReferenceRead = { link = "LspReferenceText" },
-- LspReferenceWrite = { link = "LspReferenceText" },
--
-- -- telescope
TelescopeNormal = { bg = colors.crust },
TelescopeBorder = { fg = colors.crust, bg = colors.crust },
TelescopePromptNormal = { bg = colors.mantle },
TelescopePromptPrefix = { fg = colors.mauve },
TelescopePromptBorder = { fg = colors.mantle, bg = colors.mantle },
TelescopePromptTitle = { fg = colors.crust, bg = colors.blue },
TelescopePreviewTitle = { fg = colors.crust, bg = colors.mauve },
-- Syntax
PreProc = { link = "Include" },

View file

@ -0,0 +1,20 @@
return {
options = {
custom_commentstring = function() return vim.bo.commentstring end
},
mappings = {
-- Toggle comment (like `gcip` - comment inner paragraph) for both
-- Normal and Visual modes
comment = '<leader>/',
-- Toggle comment on current line
comment_line = '<leader>//',
-- Toggle comment on visual selection
comment_visual = '<leader>/',
-- Define 'comment' textobject (like `dgc` - delete whole comment block)
-- Works also in Visual mode if mapping differs from `comment_visual`
textobject = 'gc',
}
}

View file

@ -0,0 +1,69 @@
local icons = require('config.icons')
return {
close_if_last_window = false,
hide_root_node = true,
default_component_configs = {
indent = {
indent_size = 2,
padding = 1,
-- indent guides
with_markers = true,
indent_marker = icons.tree.node,
last_indent_marker = icons.tree.nodelast,
},
icon = {
folder_open = icons.folder.open,
folder_close = icons.folder.close,
folder_empty = icons.folder.empty,
default = icons.files.text,
},
name = {
use_git_status_colors = false,
},
git_status = {
symbols = icons.gitsigns
},
file_size = {
enabled = false,
},
type = {
enabled = false,
},
last_modified = {
enabled = false,
},
created = {
enabled = false,
},
symlink_target = {
enabled = true,
},
},
event_handlers = {
{
event = "neo_tree_buffer_enter",
handler = function()
if vim.bo.filetype == "neo-tree" then
vim.cmd("setlocal statuscolumn=")
end
end,
}
},
filesystem = {
filtered_items = {
visible = true, -- when true, they will just be displayed differently than normal items
hide_dotfiles = true,
hide_gitignored = true,
hide_hidden = true, -- only works on Windows for hidden files/directories
hide_by_name = {
"node_modules",
"vendor",
},
},
follow_current_file = {
enabled = true,
},
use_libuv_file_watcher = true,
}
}

View file

@ -0,0 +1,57 @@
return {
-- A list of parser names
ensure_installed = {
"bash",
"c",
"cpp",
"ninja",
"cmake",
"dockerfile",
"make",
"lua",
"vim",
"vimdoc",
"query",
"php",
"phpdoc",
"blade",
"go",
"gomod",
"gosum",
"javascript",
"typescript",
"css",
"scss",
"html",
"vue",
"json",
"jsonc",
"yaml",
"toml",
"xml",
"glsl",
"hlsl",
"markdown"
},
-- Install parsers synchronously (only applied to `ensure_installed`)
sync_install = true,
-- Automatically install missing parsers when entering buffer
-- Recommendation: set to false if you don't have `tree-sitter` CLI installed locally
auto_install = false,
highlight = {
enable = true,
-- Setting this to true will run `:h syntax` and tree-sitter at the same time.
-- Set this to `true` if you depend on 'syntax' being enabled (like for indentation).
-- Using this option may slow down your editor, and you may see some duplicate highlights.
-- Instead of true it can also be a list of languages
additional_vim_regex_highlighting = false,
},
indent = {
enable = true
}
}

View file

@ -0,0 +1,9 @@
return {
defaults = {
mode = { "n", "v" },
["<leader>r"] = { name = "+rename" },
["<leader>b"] = { name = "+buffers" },
["<leader>f"] = { name = "+files" },
["<leader>d"] = { name = "+diagnostics" }
}
}

View file

@ -6,6 +6,7 @@ local set = vim.opt
set.termguicolors = true
set.updatetime = 50
set.showmode = false -- disable mode in the command line, because i use lualine
set.mousemoveevent = true
--
-- Editor settings
@ -14,6 +15,7 @@ set.pumheight = 20
set.hlsearch = false
set.incsearch = true
set.laststatus = 3
set.splitkeep = "screen"
set.scrolloff=20
--vim.opt.sidescrolloff = 8
set.cursorline = true
@ -60,3 +62,13 @@ vim.diagnostic.config({
source = 'always',
},
})
-- Highlight on yank
vim.api.nvim_create_autocmd('TextYankPost', {
group = vim.api.nvim_create_augroup('highlight_yank', {}),
desc = 'Hightlight selection on yank',
pattern = '*',
callback = function()
vim.highlight.on_yank { higroup = 'IncSearch', timeout = 200 }
end,
})