1
0
Fork 0
mirror of https://github.com/pnx/dotfiles synced 2026-06-16 03:14:55 +02:00

nvim: moved stuff around.

This commit is contained in:
Henrik Hautakoski 2025-04-19 11:25:56 +02:00
parent 300d300664
commit 0d7a5fab7b
22 changed files with 975 additions and 990 deletions

View file

@ -1,107 +0,0 @@
local icons = require('user.icons')
return {
'saghen/blink.cmp',
lazy = false,
version = "*",
build = 'cargo build --release',
dependencies = {
{ "xzbdmw/colorful-menu.nvim" },
{ 'L3MON4D3/LuaSnip', version = 'v2.*' },
},
opts = {
keymap = {
['<Up>'] = { 'select_prev', 'fallback' },
['<Down>'] = { 'select_next', 'fallback' },
['<C-p>'] = { 'select_prev', 'fallback' },
['<C-n>'] = { 'select_next', 'fallback' },
['<S-Tab>'] = {
function(cmp)
if cmp.snippet_active() then
return cmp.accept()
else
return cmp.select_prev()
end
end,
'snippet_backward',
'fallback'
},
['<Tab>'] = {
function(cmp)
if cmp.snippet_active() then
return cmp.accept()
else
return cmp.select_next()
end
end,
'snippet_forward',
'fallback'
},
['<CR>'] = { 'accept', 'fallback' },
},
appearance = {
nerd_font_variant = 'mono',
kind_icons = icons.symbols
},
sources = {
default = function(_)
local success, node = pcall(vim.treesitter.get_node)
if success and node and vim.tbl_contains({ 'comment', 'line_comment', 'block_comment' }, node:type()) then
return { 'buffer' }
else
return { 'lsp', 'path', 'snippets', 'buffer' }
end
end
},
snippets = {
preset = 'luasnip',
expand = function(snippet) require('luasnip').lsp_expand(snippet) end,
active = function(filter)
if filter and filter.direction then
return require('luasnip').jumpable(filter.direction)
end
return require('luasnip').in_snippet()
end,
jump = function(direction) require('luasnip').jump(direction) end,
},
completion = {
menu = {
min_width = 18,
winblend = 10,
draw = {
columns = {
{ "kind_icon" },
{ "label", "source_name", gap = 1 },
},
components = {
label = {
text = function(ctx)
return require("colorful-menu").blink_components_text(ctx)
end,
highlight = function(ctx)
return require("colorful-menu").blink_components_highlight(ctx)
end,
},
},
}
},
documentation = {
auto_show = true,
window = {
winblend = 10
}
},
ghost_text = {
enabled = true,
}
},
signature = {
enabled = true,
window = {
scrollbar = false,
winblend = 10,
}
}
}
}

View file

@ -1,90 +0,0 @@
local icons = require("user.icons")
local ui = require("user.ui.telescope")
return {
"nvim-telescope/telescope.nvim",
branch = "master",
dependencies = {
"nvim-lua/plenary.nvim",
"nvim-tree/nvim-web-devicons",
"sharkdp/fd",
},
cmd = "Telescope",
opts = function()
local utils = require("user.utils.telescope")
local actions = require("telescope.actions")
return {
defaults = {
path_display = { "filename_first", truncate = 1 },
prompt_prefix = " ",
selection_caret = icons.current .. " ",
multi_icon = icons.selected .. " ",
file_ignore_patterns = {
".git/",
"node_modules/",
},
mappings = {
i = {
['<C-p>'] = require('telescope.actions.layout').cycle_layout_next,
["<esc>"] = actions.close,
},
},
borderchars = ui.border,
preview = {
enabled = false,
filesize_limit = 0.1
},
layout_strategy = "vertical",
cycle_layout_list = { "horizontal", "vertical" },
layout_config = {
vertical = {
width = utils.width(0.5, { min = 80, max = 100, padding = 10}),
height = utils.height(0.6, { min = 15, max = 50, padding = 2}),
preview_height = 0.0
},
horizontal = {
width = utils.width(0.95, { min = 80, max = 180, padding = 10 }),
height = utils.height(0.95, { min = 15, max = 34, padding = 2 }),
preview_width = 0.5,
}
}
},
pickers = {
find_files = {
hidden = true,
},
buffers = vim.tbl_deep_extend("force", ui.dropdown, {
theme = "dropdown",
mappings = {
i = {
["<c-d>"] = actions.delete_buffer + actions.move_to_top,
},
},
sort_mru = true, -- sort by most recent used.
ignore_current_buffer = true, -- Don't show current buffer in results.
entry_maker = utils.buffer_view({
indicators = {
modified = {
icon = icons.file_status.modified,
},
readonly = {
icon = icons.file_status.readonly,
},
hidden = {
icon = icons.file_status.hidden,
}
}
})
}),
},
}
end,
config = function(_, opts)
local telescope = require("telescope")
telescope.setup(opts)
for name, _ in pairs(opts.extensions or {}) do
telescope.load_extension(name)
end
end,
}

View file

@ -1,40 +0,0 @@
local icons = require('user.icons').diff_gutter
return {
"lewis6991/gitsigns.nvim",
event = { "BufReadPre", "BufNewFile" },
dependencies = {
{
"folke/which-key.nvim",
optional = true,
opts = {
defaults = {
["<leader>g"] = { name = "+git" },
},
},
},
},
opts = {
signs = {
add = { text = icons.add },
delete = { text = icons.delete },
change = { text = icons.change },
untracked = { text = icons.untracked },
topdelete = { text = icons.delete },
changedelete = { text = icons.change },
},
signs_staged = {
add = { text = icons.add },
delete = { text = icons.delete },
change = { text = icons.change },
topdelete = { text = icons.delete },
changedelete = { text = icons.change },
},
diff_opts = {
internal = true
},
preview_config = {
border = { " " },
}
},
}

View file

@ -1,85 +1,75 @@
return {
{
"nvim-treesitter/nvim-treesitter",
build = function()
require("nvim-treesitter.install").update({ with_sync = true })
end,
opts_extend = { "ensure_installed" },
opts = {
-- Default parsers.
ensure_installed = {
-- VIM stuff
"vim",
"vimdoc",
"query",
"nvim-treesitter/nvim-treesitter",
build = function()
require("nvim-treesitter.install").update({ with_sync = true })
end,
opts_extend = { "ensure_installed" },
opts = {
-- Default parsers.
ensure_installed = {
-- VIM stuff
"vim",
"vimdoc",
"query",
-- Common config languages
"json",
"jsonc",
"yaml",
"toml",
"xml",
"kdl",
-- Common config languages
"json",
"jsonc",
"yaml",
"toml",
"xml",
"kdl",
-- misc
"comment",
"regex",
"re2c",
"xresources",
"sql",
"csv",
"ssh_config",
"printf",
"nginx",
},
auto_install = true,
highlight = {
enable = true,
additional_vim_regex_highlighting = false,
},
indent = {
enable = true,
},
-- misc
"comment",
"regex",
"re2c",
"xresources",
"sql",
"csv",
"ssh_config",
"printf",
"nginx",
},
config = function(_, opts)
local parser_config = require("nvim-treesitter.parsers").get_parser_configs()
parser_config.blade = {
install_info = {
url = "https://github.com/EmranMR/tree-sitter-blade",
branch = "main",
files = { "src/parser.c" },
},
filetype = "blade",
}
auto_install = true,
parser_config.dotenv = {
install_info = {
url = "https://github.com/pnx/tree-sitter-dotenv",
branch = "main",
files = { "src/parser.c", "src/scanner.c" },
},
filetype = "dotenv",
}
vim.filetype.add({
pattern = {
['.env.*'] = 'dotenv',
},
})
require("nvim-treesitter.configs").setup(opts)
end,
},
{
"windwp/nvim-ts-autotag",
dependencies = {
"nvim-treesitter/nvim-treesitter",
highlight = {
enable = true,
additional_vim_regex_highlighting = false,
},
indent = {
enable = true,
},
event = "InsertEnter",
opts = {}
},
config = function(_, opts)
local parser_config = require("nvim-treesitter.parsers").get_parser_configs()
parser_config.blade = {
install_info = {
url = "https://github.com/EmranMR/tree-sitter-blade",
branch = "main",
files = { "src/parser.c" },
},
filetype = "blade",
}
parser_config.dotenv = {
install_info = {
url = "https://github.com/pnx/tree-sitter-dotenv",
branch = "main",
files = { "src/parser.c", "src/scanner.c" },
},
filetype = "dotenv",
}
vim.filetype.add({
pattern = {
['.env.*'] = 'dotenv',
},
})
require("nvim-treesitter.configs").setup(opts)
end,
}