1
0
Fork 0
mirror of https://github.com/pnx/dotfiles synced 2026-06-16 03:14:55 +02:00
This commit is contained in:
Henrik Hautakoski 2024-06-23 16:12:05 +02:00
parent 35c3cc49d5
commit 08bf9aad64
14 changed files with 264 additions and 110 deletions

View file

@ -1,33 +1,34 @@
{
"LuaSnip": { "branch": "master", "commit": "50fcf17db7c75af80e6b6109acfbfb4504768780" },
"catppuccin": { "branch": "main", "commit": "5215ea59df6d0a7e27da9a5cd1165e06d1b04cbe" },
"catppuccin": { "branch": "main", "commit": "67565cd353fa543fa30cb738570c2e4c87da3e9c" },
"cmp-buffer": { "branch": "main", "commit": "3022dbc9166796b644a841a02de8dd1cc1d311fa" },
"cmp-nvim-lsp": { "branch": "main", "commit": "39e2eda76828d88b773cc27a3f61d2ad782c922d" },
"cmp-path": { "branch": "main", "commit": "91ff86cd9c29299a64f968ebb45846c485725f23" },
"conform.nvim": { "branch": "master", "commit": "069e971295a34a810484b7b2ef54b3c735214181" },
"fd": { "branch": "master", "commit": "be815c261ace9cd0026cff5c8a579cda094e10fd" },
"gitsigns.nvim": { "branch": "main", "commit": "4a143f13e122ab91abdc88f89eefbe70a4858a56" },
"conform.nvim": { "branch": "master", "commit": "9a06e83527407a7600a2fe4e0d10adf432b6215e" },
"fd": { "branch": "master", "commit": "f8270a6a447648a087c968552aa80325277a5588" },
"friendly-snippets": { "branch": "main", "commit": "682157939e57bd6a2c86277dfd4d6fbfce63dbac" },
"gitsigns.nvim": { "branch": "main", "commit": "0dc886637f9686b7cfd245a4726f93abeab19d4a" },
"indent-blankline.nvim": { "branch": "master", "commit": "d98f537c3492e87b6dc6c2e3f66ac517528f406f" },
"lazy.nvim": { "branch": "main", "commit": "eb4957442e3182f051b0ae11da32e06d22c190e3" },
"lazy.nvim": { "branch": "main", "commit": "bc620783663ab09d16bff9fdecc07da65b2a1528" },
"lsp-zero.nvim": { "branch": "v3.x", "commit": "16de3b18c5f7b6230d89b8e64ce9a4801b6f8d08" },
"lspkind-nvim": { "branch": "master", "commit": "1735dd5a5054c1fb7feaf8e8658dbab925f4f0cf" },
"lualine-lsp-progress": { "branch": "master", "commit": "56842d097245a08d77912edf5f2a69ba29f275d7" },
"lualine.nvim": { "branch": "master", "commit": "0a5a66803c7407767b799067986b4dc3036e1983" },
"mini.nvim": { "branch": "main", "commit": "cc2f5b542c38b2af234b62196fa5a8621119fb0c" },
"none-ls.nvim": { "branch": "main", "commit": "8691504118b252d64fc5023a104aedd100ab754a" },
"mini.nvim": { "branch": "main", "commit": "a3f274633a57c713160baf51724ecfc051117877" },
"none-ls.nvim": { "branch": "main", "commit": "cc0a3c45047e3daf85d07c1571d65476cfce6480" },
"nvim-autopairs": { "branch": "master", "commit": "c15de7e7981f1111642e7e53799e1211d4606cb9" },
"nvim-cmp": { "branch": "main", "commit": "5260e5e8ecadaf13e6b82cf867a909f54e15fd07" },
"nvim-lspconfig": { "branch": "master", "commit": "92166b89ab4b3d60f24e58170cac53b7141fd032" },
"nvim-treesitter": { "branch": "master", "commit": "c5cbd3ec74f6f5ddbac939e6f24b99fe78262b4c" },
"nvim-cmp": { "branch": "main", "commit": "a110e12d0b58eefcf5b771f533fc2cf3050680ac" },
"nvim-lspconfig": { "branch": "master", "commit": "6806370929cf6a35be6e5e0e74588515a4356e4d" },
"nvim-treesitter": { "branch": "master", "commit": "7b04b398f868563cac37ae90baffd7c3dca513fe" },
"nvim-treesitter-textobjects": { "branch": "master", "commit": "34867c69838078df7d6919b130c0541c0b400c47" },
"nvim-ts-autotag": { "branch": "main", "commit": "6eb4120a1aadef07ac312f1c4bc6456712220007" },
"nvim-web-devicons": { "branch": "master", "commit": "b4b302d6ae229f67df7a87ef69fa79473fe788a9" },
"oil.nvim": { "branch": "master", "commit": "e5312c3a801e7274fa14e6a56aa10a618fed80c3" },
"nvim-ts-autotag": { "branch": "main", "commit": "06fe07d7523ba8c755fac7c913fceba43b1720ee" },
"nvim-web-devicons": { "branch": "master", "commit": "c0cfc1738361b5da1cd0a962dd6f774cc444f856" },
"oil.nvim": { "branch": "master", "commit": "4c574cf4a2de736d2662d52ce086d8bdf87c49df" },
"playground": { "branch": "master", "commit": "ba48c6a62a280eefb7c85725b0915e021a1a0749" },
"plenary.nvim": { "branch": "master", "commit": "a3e3bc82a3f95c5ed0d7201546d5d2c19b20d683" },
"telescope-ui-select.nvim": { "branch": "master", "commit": "6e51d7da30bd139a6950adf2a47fda6df9fa06d2" },
"telescope.nvim": { "branch": "master", "commit": "dfa230be84a044e7f546a6c2b0a403c739732b86" },
"trouble.nvim": { "branch": "main", "commit": "38915023a777b7f2422e503dc603f6a64b465bf5" },
"vim-fugitive": { "branch": "master", "commit": "4f59455d2388e113bd510e85b310d15b9228ca0d" },
"telescope.nvim": { "branch": "master", "commit": "c392f1b78eaaf870ca584bd698e78076ed301b26" },
"trouble.nvim": { "branch": "main", "commit": "2d8610a07033f2b367e71230ab128f8b89c2639d" },
"vim-fugitive": { "branch": "master", "commit": "64d6cafb9dcbacce18c26d7daf617ebb96b273f3" },
"which-key.nvim": { "branch": "main", "commit": "0099511294f16b81c696004fa6a403b0ae61f7a0" }
}

View file

@ -33,7 +33,7 @@ return function()
["<Down>"] = selectNext,
["<Tab>"] = selectNext,
["<C-c>"] = cmp.mapping.abort(),
["<CR>"] = utils.confirm({ select = true }),
["<CR>"] = utils.confirm({ behavior = cmp.ConfirmBehavior.Replace, select = true }),
},
snippet = {
expand = function(args)
@ -52,7 +52,7 @@ return function()
},
sources = {
{ name = "nvim_lsp" },
-- { name = "luasnip" },
{ name = "luasnip" },
{ name = "buffer" },
{ name = "path" },
{
@ -66,10 +66,10 @@ return function()
},
},
},
experimental = {
ghost_text = {
hl_group = "NonText",
},
},
-- experimental = {
-- ghost_text = {
-- hl_group = "NonText",
-- },
-- },
}
end

View file

@ -9,4 +9,14 @@ return {
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
}
}

View file

@ -14,6 +14,8 @@ return {
servers = {
-- Bash
bashls = {},
-- C/C++
ccls = {},
-- PHP
-- intelephense = {},
phpactor = {

View file

@ -1,15 +1,15 @@
local icons = require('config.icons')
local separator = { "'" .. icons.separator .. "'", color = 'StatusLineSeparator' }
local icons = require("config.icons")
local separator = { "'" .. icons.separator .. "'", color = "StatusLineSeparator" }
return {
options = {
globalstatus = true,
component_separators = '',
section_separators = '',
component_separators = "",
section_separators = "",
disabled_filetypes = {
statusline = {
'dashboard',
}
"dashboard",
},
},
theme = {
normal = {
@ -35,8 +35,8 @@ return {
replace = {
a = "StatusLineReplace",
z = "StatusLine",
}
}
},
},
},
sections = {
lualine_a = {
@ -55,39 +55,60 @@ return {
{
"diagnostics",
symbols = {
error = icons.diagnostics.error .. ' ',
warn = icons.diagnostics.warn .. ' ',
info = icons.diagnostics.info .. ' ',
hint = icons.diagnostics.hint .. ' ',
error = icons.diagnostics.error .. " ",
warn = icons.diagnostics.warn .. " ",
info = icons.diagnostics.info .. " ",
hint = icons.diagnostics.hint .. " ",
},
},
{
"diff",
symbols = {
added = icons.diff.added .. ' ',
modified = icons.diff.modified .. ' ',
removed = icons.diff.removed .. ' '
}
added = icons.diff.added .. " ",
modified = icons.diff.modified .. " ",
removed = icons.diff.removed .. " ",
},
},
separator,
},
lualine_c = {
'filename'
{
"filename",
path = 1,
symbols = {
modified = "+",
readonly = "[R]",
unnamed = "-",
newfile = "[New]",
},
},
},
lualine_x = {
'filetype',
'fileformat',
"filetype",
"fileformat",
'(vim.bo.expandtab and "SPC" or "TAB") .. " " .. vim.bo.shiftwidth',
},
lualine_y = {
separator,
'location',
'progress'
"location",
"progress",
},
lualine_z = {},
},
winbar = {
lualine_c = {
{ "filetype", icon_only = true },
"filename",
},
},
inactive_winbar = {
lualine_c = {
{ "filetype", icon_only = true },
"filename",
},
lualine_z = {}
},
extensions = {
'lazy',
'neo-tree'
}
"lazy",
"neo-tree",
},
}

View file

@ -1,14 +1,17 @@
local icons = require("config.icons")
return function()
local icons = require("config.icons")
local actions = require("telescope.actions")
local dropdown_opts = {
previewer = false,
prompt_title = false,
layout_strategy = "horizontal",
layout_config = {
prompt_position = "top",
},
}
return {
defaults = {
border = {
prompt = { 1, 1, 1, 1 },
results = { 1, 1, 1, 1 },
preview = { 1, 1, 1, 1 },
},
path_display = { truncate = 1 },
prompt_prefix = " ",
selection_caret = icons.current .. " ",
@ -27,19 +30,18 @@ return function()
find_files = {
hidden = true,
},
buffers = {
buffers = vim.tbl_deep_extend("force", dropdown_opts, {
theme = "dropdown",
previewer = false,
mappings = {
i = {
["<c-d>"] = actions.delete_buffer + actions.move_to_top,
},
},
},
}),
},
extensions = {
["ui-select"] = {
require("telescope.themes").get_dropdown(),
require("telescope.themes").get_dropdown(dropdown_opts),
},
},
}

View file

@ -16,6 +16,7 @@ return {
"phpdoc",
"blade",
"go",
"gotmpl",
"gomod",
"gosum",
"javascript",

View file

@ -177,10 +177,10 @@ return {
opts = require("config.oil"),
dependencies = { "nvim-tree/nvim-web-devicons" },
config = function(_, opts)
require('oil').setup(opts)
require("oil").setup(opts)
-- Don't touch my CWD!
require('utils.oil').RegisterCWDHackHook()
require("utils.oil").RegisterCWDHackHook()
end,
},
{
@ -191,6 +191,14 @@ return {
},
{
"L3MON4D3/LuaSnip",
dependencies = {
{
"rafamadriz/friendly-snippets",
config = function()
require("luasnip.loaders.from_vscode").lazy_load()
end,
},
},
opts = {},
config = function(_, opts)
require("luasnip.loaders.from_lua").load({ paths = "~/.config/nvim/snippets" })

View file

@ -20,8 +20,8 @@ return {
"hrsh7th/cmp-buffer", -- autocomplete from buffer
"hrsh7th/cmp-path", -- autocomplete from filesystem
"hrsh7th/cmp-nvim-lsp", -- autocomplete from lsp
-- "saadparwaiz1/cmp_luasnip", -- autocomplete from snippet engine
-- "L3MON4D3/LuaSnip", -- snippet engine
"saadparwaiz1/cmp_luasnip", -- autocomplete from snippet engine
"L3MON4D3/LuaSnip", -- snippet engine
"onsails/lspkind-nvim", -- icons for kind
},
opts = require("config.cmp"),
@ -39,6 +39,7 @@ return {
local lsp_zero = require("lsp-zero")
local lsp_config = require("lspconfig")
local augroup = vim.api.nvim_create_augroup("Lsp", {})
local utils = require("utils.lsp")
local map = require("utils.keys")
lsp_zero.on_attach(function(_, bufnr)
@ -60,8 +61,12 @@ return {
})
end
if client.supports_method('textDocument/hover') then
--utils.signature_help_on_hover(bufnr)
end
if (opts.document_hightlight or server_opt.document_highlight or false) and client.supports_method('textDocument/documentHighlight') then
require("utils.lsp").document_highlight(bufnr)
utils.document_highlight(bufnr)
end
end

View file

@ -17,4 +17,14 @@ function M.CloseAll()
end
end
function M.GetLoaded()
local loaded = {}
for i, hnd in ipairs(vim.api.nvim_list_bufs()) do
if vim.api.nvim_buf_is_loaded(hnd) then
loaded[i] = hnd
end
end
return loaded
end
return M

View file

@ -1,6 +1,5 @@
local luasnip = require('luasnip')
local cmp = require('cmp')
local luasnip = require("luasnip")
local cmp = require("cmp")
local M = {}
@ -31,11 +30,11 @@ end
function M.confirm(opts)
return cmp.mapping(function(fallback)
if cmp.visible() then
if luasnip.expand_or_jumpable() then
luasnip.expand_or_jump()
else
-- if luasnip.expand_or_jumpable() then
-- luasnip.expand_or_jump()
-- else
cmp.confirm(opts or {})
end
-- end
else
fallback()
end

View file

@ -19,4 +19,14 @@ function M.document_highlight(bufnr)
})
end
function M.signature_help_on_hover(bufnr)
local group = vim.api.nvim_create_augroup('lsp_hover', { clear = false })
vim.api.nvim_create_autocmd({ 'CursorHold', 'CursorHoldI' }, {
group = group,
buffer = bufnr,
callback = vim.lsp.buf.hover,
})
end
return M

View file

@ -0,0 +1,84 @@
; extends: html
[
(field)
(field_identifier)
] @property
(variable) @variable
; Function calls
(function_call
function: (identifier) @function)
(method_call
method: (selector_expression
field: (field_identifier) @method))
; Operators
"|" @operator
":=" @operator
; Builtin functions
((identifier) @function.builtin
(#match? @function.builtin "^(and|call|html|index|slice|js|len|not|or|print|printf|println|urlquery|eq|ne|lt|ge|gt|ge)$"))
; Delimiters
"." @punctuation.delimiter
"," @punctuation.delimiter
"{{" @punctuation.bracket
"}}" @punctuation.bracket
"{{-" @punctuation.bracket
"-}}" @punctuation.bracket
")" @punctuation.bracket
"(" @punctuation.bracket
; Keywords
[
"else"
"else if"
"if"
"with"
] @conditional
[
"range"
"end"
"template"
"define"
"block"
] @keyword
; Literals
[
(interpreted_string_literal)
(raw_string_literal)
(rune_literal)
] @string
(escape_sequence) @string.special
[
(int_literal)
(float_literal)
(imaginary_literal)
] @number
[
(true)
(false)
] @boolean
[
(nil)
] @constant.builtin
(comment) @comment
(ERROR) @error

View file

@ -0,0 +1 @@
(text) @html