1
0
Fork 0

neovim: cleanup

This commit is contained in:
Vladimír Dudr 2022-11-03 15:05:24 +01:00
parent 4dd5b2ec24
commit f313eb7f69
17 changed files with 448 additions and 458 deletions

View file

@ -0,0 +1 @@
setlocal tabstop=2 shiftwidth=2

View file

@ -2,3 +2,9 @@ root = true
[*.lua] [*.lua]
indent_style = space indent_style = space
indent_size = 2 indent_size = 2
tab_width = 4
quote_style = single
insert_final_newline = true
call_arg_parentheses = keep
table_separator_style = comma

View file

@ -1,62 +1,8 @@
require("configs.packages").setup() require('configs.packages').setup()
require("configs.options").setup() require('configs.options').setup()
require('configs.neoray')
require('configs.colors')
require('configs.misc')
-- vsnip {{{
vim.cmd 'imap <expr> <Tab> vsnip#jumpable(1) ? \'<Plug>(vsnip-jump-next)\' : \'<Tab>\''
vim.cmd 'smap <expr> <Tab> vsnip#jumpable(1) ? \'<Plug>(vsnip-jump-next)\' : \'<Tab>\''
vim.cmd 'imap <expr> <S-Tab> vsnip#jumpable(-1) ? \'<Plug>(vsnip-jump-prev)\' : \'<S-Tab>\''
vim.cmd 'smap <expr> <S-Tab> vsnip#jumpable(-1) ? \'<Plug>(vsnip-jump-prev)\' : \'<S-Tab>\''
-- vsnip }}}
-- dressing.nvim {{{
require('dressing').setup({
input = {
relative = "editor",
},
})
-- }}}
-- Indent lines {{{
vim.g.indent_blankline_filetype_exclude = { 'help', 'NvimTree', 'TelescopePrompt', 'lspinfo' }
vim.g.indent_blankline_buftype_exclude = { 'terminal', 'nofile', 'prompt' }
-- indent lines }}}
-- NEORAY {{{
vim.o.guifont = "Noto Sans Mono:14h"
vim.cmd [[
if exists('g:neoray')
NeoraySet CursorAnimTime 0
NeoraySet Transparency 0.95
NeoraySet TargetTPS 120
NeoraySet ContextMenuOn FALSE
NeoraySet BoxDrawingOn TRUE
NeoraySet WindowSize 100x40
NeoraySet WindowState none
NeoraySet KeyZoomIn <>
NeoraySet KeyZoomOut <>
endif ]]
-- }}}
require("configs.colors")
-- }}}
-- {{{ LAYA
vim.cmd [[
augroup layaAbbrevs
autocmd BufRead,BufNewFile ~/jopixel/**/*.php iabbrev <buffer> TR $this->obtainer()->translator()->t();<Left><Left>
autocmd BufRead,BufNewFile ~/jopixel/**/*.php iabbrev <buffer> TI $this->obtainer()->translator()->t()<Left>
autocmd BufRead,BufNewFile ~/jopixel/**/*.php iabbrev <buffer> LOG $this->obtainer()->logger()->log();<Left><Left>
autocmd BufRead,BufNewFile ~/jopixel/**/*.php iabbrev <buffer> DBG $this->obtainer()->logger()->log('debug', 'debug',);<Left><Left>
autocmd BufRead,BufNewFile ~/jopixel/**/*.php iabbrev <buffer> PROD $this->producer()
autocmd BufRead,BufNewFile ~/jopixel/**/*.php iabbrev <buffer> FILE $this->producer()->file()<Left>
autocmd BufRead,BufNewFile ~/jopixel/**/*.php iabbrev <buffer> LINK $this->producer()->link($this, '')<Left><Left>
autocmd BufRead,BufNewFile ~/jopixel/**/*.php iabbrev <buffer> NW $this->obtainer()->notifications()->warning();<Left><Left>
autocmd BufRead,BufNewFile ~/jopixel/**/*.php iabbrev <buffer> NS $this->obtainer()->notifications()->success();<Left><Left>
augroup END
]]
-- }}} LAYA
-- vim: sw=2: ts=2: fdm=marker: -- vim: sw=2: ts=2: fdm=marker:

View file

@ -1,14 +1,14 @@
local hl = function(group, opts) local function normalizeTSHighlight() --- {{{
if (opts.default == nil) then -- helper {{{
opts.default = true local hl = function(group, opts)
if (opts.default == nil) then
opts.default = true
end
vim.api.nvim_set_hl(0, group, opts)
end end
vim.api.nvim_set_hl(0, group, opts) -- }}}
end
local function normalizeTSHighlight()
-- Misc {{{ -- Misc {{{
hl('@comment', { link = 'Comment' }) hl('@comment', { link = 'Comment' })
-- hl('@error', {link = 'Error'})
hl('@none', { bg = 'NONE', fg = 'NONE' }) hl('@none', { bg = 'NONE', fg = 'NONE' })
hl('@preproc', { link = 'PreProc' }) hl('@preproc', { link = 'PreProc' })
hl('@define', { link = 'Define' }) hl('@define', { link = 'Define' })
@ -103,16 +103,9 @@ local function normalizeTSHighlight()
hl('@tag.attribute', { link = 'Identifier' }) hl('@tag.attribute', { link = 'Identifier' })
hl('@tag.delimiter', { link = 'Delimiter' }) hl('@tag.delimiter', { link = 'Delimiter' })
-- }}} -- }}}
end end -- }}}
local function customLinks() local function normalizeTerminal() -- {{{
local cterm = vim.api.nvim_get_hl_by_name('Normal', false)
local gui = vim.api.nvim_get_hl_by_name('Normal', true)
hl('Function', { ctermfg = cterm.foreground, fg = gui.foreground, default = false })
hl('Operator', { ctermfg = cterm.foreground, fg = gui.foreground, default = false })
end
local function normalizeTerminal()
vim.g.terminal_color_0 = 0 vim.g.terminal_color_0 = 0
vim.g.terminal_color_1 = 1 vim.g.terminal_color_1 = 1
vim.g.terminal_color_2 = 2 vim.g.terminal_color_2 = 2
@ -129,12 +122,19 @@ local function normalizeTerminal()
vim.g.terminal_color_13 = 13 vim.g.terminal_color_13 = 13
vim.g.terminal_color_14 = 14 vim.g.terminal_color_14 = 14
vim.g.terminal_color_15 = 15 vim.g.terminal_color_15 = 15
end -- }}}
local function customLinks()
local cterm = vim.api.nvim_get_hl_by_name('Normal', false)
local gui = vim.api.nvim_get_hl_by_name('Normal', true)
vim.api.nvim_set_hl(0, 'Function', { ctermfg = cterm.foreground, fg = gui.foreground })
vim.api.nvim_set_hl(0, 'Operator', { ctermfg = cterm.foreground, fg = gui.foreground })
end end
local augr = vim.api.nvim_create_augroup('config_colorscheme', {}); local augr = vim.api.nvim_create_augroup('config_colorscheme', {});
vim.api.nvim_create_autocmd('Colorscheme', { vim.api.nvim_create_autocmd('Colorscheme', {
group = augr, group = augr,
pattern = "*", pattern = '*',
callback = function() callback = function()
normalizeTSHighlight() normalizeTSHighlight()
customLinks() customLinks()
@ -142,12 +142,13 @@ vim.api.nvim_create_autocmd('Colorscheme', {
end end
}) })
vim.api.nvim_create_autocmd('Colorscheme', { vim.api.nvim_create_autocmd('Colorscheme', {
group = augr, group = augr,
pattern = "gruvbox", pattern = 'gruvbox',
callback = function() callback = function()
hl('Directory', { link = 'GruvboxGreen', default = false }) vim.api.nvim_set_hl(0, 'Directory', { link = 'GruvboxGreen' })
vim.api.nvim_set_hl(0, 'TelescopeSelection', { link = 'GruvboxOrangeSign' })
vim.api.nvim_set_hl(0, 'TelescopeMatching', { link = 'GruvboxAqua' })
end end
}) })

View file

@ -2,11 +2,11 @@ local M = {}
function M.setup() function M.setup()
local fterm = require("FTerm") local fterm = require('FTerm')
local lazygit = fterm:new({ local lazygit = fterm:new({
-- ft = 'fterm_lazygit', -- You can also override the default filetype, if you want -- ft = 'fterm_lazygit', -- You can also override the default filetype, if you want
cmd = "lazygit", cmd = 'lazygit',
dimensions = { dimensions = {
height = 0.9, height = 0.9,
width = 0.9 width = 0.9
@ -20,7 +20,7 @@ function M.setup()
vim.keymap.set('n', '<Space>H', function() vim.keymap.set('n', '<Space>H', function()
local file = vim.api.nvim_buf_get_name(0) local file = vim.api.nvim_buf_get_name(0)
local cmd = 'git log -p --ext-diff '..file local cmd = 'git log -p --ext-diff ' .. file
local git_history = fterm:new({ local git_history = fterm:new({
-- ft = 'git_history', -- You can also override the default filetype, if you want -- ft = 'git_history', -- You can also override the default filetype, if you want
cmd = cmd, cmd = cmd,

View file

@ -32,7 +32,7 @@ local function on_attach(args)
vim.keymap.set('n', 'gD', vim.lsp.buf.declaration, opts) vim.keymap.set('n', 'gD', vim.lsp.buf.declaration, opts)
end end
if client.supports_method("textDocument/hover") and client.name ~= 'null-ls' then if client.supports_method('textDocument/hover') and client.name ~= 'null-ls' then
vim.keymap.set('n', 'K', vim.lsp.buf.hover, opts) vim.keymap.set('n', 'K', vim.lsp.buf.hover, opts)
end end
@ -61,7 +61,7 @@ local function on_attach(args)
end end
function M.setup() function M.setup()
require("neodev").setup({}) require('neodev').setup({})
vim.api.nvim_create_autocmd('LspAttach', { vim.api.nvim_create_autocmd('LspAttach', {
callback = on_attach callback = on_attach
@ -103,12 +103,12 @@ function M.setup()
replace = { replace = {
['openapi.json'] = { ['openapi.json'] = {
description = 'A JSON schema for Open API documentation files', description = 'A JSON schema for Open API documentation files',
fileMatch = { "openapi.json", "openapi.yml", "openapi.yaml", "openapi/*.json" }, fileMatch = { 'openapi.json', 'openapi.yml', 'openapi.yaml', 'openapi/*.json' },
name = 'openapi.json', name = 'openapi.json',
url = 'https://raw.githubusercontent.com/OAI/OpenAPI-Specification/main/schemas/v3.0/schema.json', url = 'https://raw.githubusercontent.com/OAI/OpenAPI-Specification/main/schemas/v3.0/schema.json',
versions = { versions = {
["3.1"] = "https://raw.githubusercontent.com/OAI/OpenAPI-Specification/main/schemas/v3.1/schema.json", ['3.1'] = 'https://raw.githubusercontent.com/OAI/OpenAPI-Specification/main/schemas/v3.1/schema.json',
["3.0"] = "https://raw.githubusercontent.com/OAI/OpenAPI-Specification/main/schemas/v3.0/schema.json", ['3.0'] = 'https://raw.githubusercontent.com/OAI/OpenAPI-Specification/main/schemas/v3.0/schema.json',
} }
}, },
}, },
@ -143,7 +143,7 @@ function M.setup()
capabilities = capabilities, capabilities = capabilities,
} }
local util = require("lspconfig.util") --[[ local util = require("lspconfig.util")
require("lspconfig.configs").coffeesense = { require("lspconfig.configs").coffeesense = {
default_config = { default_config = {
cmd = { '/home/vladimir/devel/coffeesense/server/bin/coffeesense-language-server' }, cmd = { '/home/vladimir/devel/coffeesense/server/bin/coffeesense-language-server' },
@ -158,7 +158,7 @@ function M.setup()
} }
} }
require("lspconfig").coffeesense.setup({}) require("lspconfig").coffeesense.setup({}) ]]
end end

View file

@ -0,0 +1,21 @@
-- {{{ LAYA
local aug = vim.api.nvim_create_augroup('laya', {})
vim.api.nvim_create_autocmd({ 'BufRead', 'BufNewFile' }, {
group = aug,
pattern = '~/jopixel/**/*.php',
callback = function()
vim.cmd.iabbrev({ args = { '<buffer>', 'TR', '$this->obtainer()->translator()->t();<Left><Left>' } })
vim.cmd.iabbrev({ args = { '<buffer>', 'TI', '$this->obtainer()->translator()->t()<Left>' } })
vim.cmd.iabbrev({ args = { '<buffer>', 'LOG', '$this->obtainer()->logger()->log();<Left><Left>' } })
vim.cmd.iabbrev({ args = { '<buffer>', 'DBG', "$this->obtainer()->logger()->log('debug', 'debug',);<Left><Left>" } })
vim.cmd.iabbrev({ args = { '<buffer>', 'PROD', '$this->producer()' } })
vim.cmd.iabbrev({ args = { '<buffer>', 'FILE', '$this->producer()->file()<Left>' } })
vim.cmd.iabbrev({ args = { '<buffer>', 'LINK', "$this->producer()->link($this, '')<Left><Left>" } })
vim.cmd.iabbrev({ args = { '<buffer>', 'NW', '$this->obtainer()->notifications()->warning();<Left><Left>' } })
vim.cmd.iabbrev({ args = { '<buffer>', 'NS', '$this->obtainer()->notifications()->success();<Left><Left>' } })
end
})
-- }}} LAYA

View file

@ -0,0 +1,15 @@
vim.o.guifont = 'Noto Sans Mono:14h'
if not vim.g.neoray then
return
end
vim.cmd.NeoraySet('CursorAnimTime', 0)
vim.cmd.NeoraySet('Transparency', 0.95)
vim.cmd.NeoraySet('TargetTPS', 120)
vim.cmd.NeoraySet('ContextMenuOn', false)
vim.cmd.NeoraySet('BoxDrawingOn', true)
vim.cmd.NeoraySet('WindowSize', '100x40')
vim.cmd.NeoraySet('WindowState', 'none')
vim.cmd.NeoraySet('KeyZoomIn', '<>')
vim.cmd.NeoraySet('KeyZoomOut', '<>')

View file

@ -1,223 +1,211 @@
local M = {} local M = {}
function M.setup() function M.setup()
vim.cmd([[ let g:neo_tree_remove_legacy_commands = 1 ]]) vim.cmd([[ let g:neo_tree_remove_legacy_commands = 1 ]])
-- If you want icons for diagnostic errors, you'll need to define them somewhere: require('neo-tree').setup({
--[[ vim.fn.sign_define("DiagnosticSignError", close_if_last_window = false, -- Close Neo-tree if it is the last window left in the tab
{ text = "", texthl = "DiagnosticSignError" }) popup_border_style = 'rounded',
vim.fn.sign_define("DiagnosticSignWarn", enable_git_status = true,
{ text = "", texthl = "DiagnosticSignWarn" }) enable_diagnostics = false,
vim.fn.sign_define("DiagnosticSignInfo", sort_case_insensitive = false, -- used when sorting files and directories in the tree
{ text = "", texthl = "DiagnosticSignInfo" }) sort_function = nil, -- use a custom function for sorting files and directories in the tree
vim.fn.sign_define("DiagnosticSignHint", -- sort_function = function (a,b)
{ text = "", texthl = "DiagnosticSignHint" }) ]] -- if a.type == b.type then
-- NOTE: this is changed from v1.x, which used the old style of highlight groups -- return a.path > b.path
-- in the form "LspDiagnosticsSignWarning" -- else
-- return a.type > b.type
require("neo-tree").setup({ -- end
close_if_last_window = false, -- Close Neo-tree if it is the last window left in the tab -- end , -- this sorts files and directories descendantly
popup_border_style = "rounded", default_component_configs = {
enable_git_status = true, container = {
enable_diagnostics = false, enable_character_fade = true
sort_case_insensitive = false, -- used when sorting files and directories in the tree },
sort_function = nil, -- use a custom function for sorting files and directories in the tree indent = {
-- sort_function = function (a,b) indent_size = 2,
-- if a.type == b.type then padding = 1, -- extra padding on left hand side
-- return a.path > b.path -- indent guides
-- else with_markers = true,
-- return a.type > b.type indent_marker = '',
-- end last_indent_marker = '',
-- end , -- this sorts files and directories descendantly highlight = 'NeoTreeIndentMarker',
default_component_configs = { -- expander config, needed for nesting files
container = { with_expanders = nil, -- if nil and file nesting is enabled, will enable expanders
enable_character_fade = true expander_collapsed = '',
}, expander_expanded = '',
indent = { expander_highlight = 'NeoTreeExpander',
indent_size = 2, },
padding = 1, -- extra padding on left hand side icon = {
-- indent guides folder_closed = '',
with_markers = true, folder_open = '',
indent_marker = "", folder_empty = '',
last_indent_marker = "", -- The next two settings are only a fallback, if you use nvim-web-devicons and configure default icons there
highlight = "NeoTreeIndentMarker", -- then these will never be used.
-- expander config, needed for nesting files default = '*',
with_expanders = nil, -- if nil and file nesting is enabled, will enable expanders highlight = 'NeoTreeFileIcon'
expander_collapsed = "", },
expander_expanded = "", modified = {
expander_highlight = "NeoTreeExpander", symbol = '[+]',
}, highlight = 'NeoTreeModified',
icon = { },
folder_closed = "", name = {
folder_open = "", trailing_slash = false,
folder_empty = "", use_git_status_colors = true,
-- The next two settings are only a fallback, if you use nvim-web-devicons and configure default icons there highlight = 'NeoTreeFileName',
-- then these will never be used. },
default = "*", git_status = {
highlight = "NeoTreeFileIcon" symbols = {
}, -- Change type
modified = { added = '', -- or "✚", but this is redundant info if you use git_status_colors on the name
symbol = "[+]", modified = '', -- or "", but this is redundant info if you use git_status_colors on the name
highlight = "NeoTreeModified", deleted = '', -- this can only be used in the git_status source
}, renamed = '', -- this can only be used in the git_status source
name = { -- Status type
trailing_slash = false, untracked = '',
use_git_status_colors = true, ignored = '',
highlight = "NeoTreeFileName", unstaged = '',
}, staged = '',
git_status = { conflict = '',
symbols = {
-- Change type
added = "", -- or "✚", but this is redundant info if you use git_status_colors on the name
modified = "", -- or "", but this is redundant info if you use git_status_colors on the name
deleted = "", -- this can only be used in the git_status source
renamed = "", -- this can only be used in the git_status source
-- Status type
untracked = "",
ignored = "",
unstaged = "",
staged = "",
conflict = "",
}
},
},
window = {
position = "left",
width = 40,
mapping_options = {
noremap = true,
nowait = true,
},
mappings = {
["<space>"] = {
"toggle_node",
nowait = false, -- disable `nowait` if you have existing combos starting with this char that you want to use
},
["<2-LeftMouse>"] = "open",
["<cr>"] = "open",
["<esc>"] = "revert_preview",
["P"] = { "toggle_preview", config = { use_float = true } },
["S"] = "open_split",
["s"] = "open_vsplit",
-- ["S"] = "split_with_window_picker",
-- ["s"] = "vsplit_with_window_picker",
["t"] = "open_tabnew",
-- ["<cr>"] = "open_drop",
-- ["t"] = "open_tab_drop",
["w"] = "open_with_window_picker",
--["P"] = "toggle_preview", -- enter preview mode, which shows the current node without focusing
["C"] = "close_node",
["z"] = "close_all_nodes",
--["Z"] = "expand_all_nodes",
["a"] = {
"add",
-- some commands may take optional config options, see `:h neo-tree-mappings` for details
config = {
show_path = "none" -- "none", "relative", "absolute"
}
},
["A"] = "add_directory", -- also accepts the optional config.show_path option like "add".
["d"] = "delete",
["r"] = "rename",
["y"] = "copy_to_clipboard",
["x"] = "cut_to_clipboard",
["p"] = "paste_from_clipboard",
["c"] = "copy", -- takes text input for destination, also accepts the optional config.show_path option like "add":
-- ["c"] = {
-- "copy",
-- config = {
-- show_path = "none" -- "none", "relative", "absolute"
-- }
--}
["m"] = "move", -- takes text input for destination, also accepts the optional config.show_path option like "add".
["q"] = "close_window",
["R"] = "refresh",
["?"] = "show_help",
["<"] = "prev_source",
[">"] = "next_source",
}
},
nesting_rules = {},
filesystem = {
filtered_items = {
visible = false, -- 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"
},
hide_by_pattern = { -- uses glob style patterns
--"*.meta",
--"*/src/*/tsconfig.json",
},
always_show = { -- remains visible even if other settings would normally hide it
".config",
--".gitignored",
},
never_show = { -- remains hidden even if visible is toggled to true, this overrides always_show
--".DS_Store",
--"thumbs.db"
},
never_show_by_pattern = { -- uses glob style patterns
".null-ls_*",
},
},
follow_current_file = false, -- This will find and focus the file in the active buffer every
-- time the current file is changed while the tree is open.
group_empty_dirs = false, -- when true, empty folders will be grouped together
hijack_netrw_behavior = "open_default", -- netrw disabled, opening a directory opens neo-tree
-- in whatever position is specified in window.position
-- "open_current", -- netrw disabled, opening a directory opens within the
-- window like netrw would, regardless of window.position
-- "disabled", -- netrw left alone, neo-tree does not handle opening dirs
use_libuv_file_watcher = true, -- This will use the OS level file watchers to detect changes
-- instead of relying on nvim autocmd events.
window = {
mappings = {
["<bs>"] = "navigate_up",
["."] = "set_root",
["H"] = "toggle_hidden",
["/"] = "noop",
["D"] = "fuzzy_finder_directory",
["f"] = "filter_on_submit",
["<c-x>"] = "clear_filter",
["[g"] = "prev_git_modified",
["]g"] = "next_git_modified",
}
}
},
buffers = {
follow_current_file = true, -- This will find and focus the file in the active buffer every
-- time the current file is changed while the tree is open.
group_empty_dirs = true, -- when true, empty folders will be grouped together
show_unloaded = true,
window = {
mappings = {
["bd"] = "buffer_delete",
["<bs>"] = "navigate_up",
["."] = "set_root",
}
},
},
git_status = {
window = {
position = "float",
mappings = {
["A"] = "git_add_all",
["gu"] = "git_unstage_file",
["ga"] = "git_add_file",
["gr"] = "git_revert_file",
["gc"] = "git_commit",
["gp"] = "git_push",
["gg"] = "git_commit_and_push",
}
}
} }
}) },
},
window = {
position = 'left',
width = 40,
mapping_options = {
noremap = true,
nowait = true,
},
mappings = {
['<space>'] = {
'toggle_node',
nowait = false, -- disable `nowait` if you have existing combos starting with this char that you want to use
},
['<2-LeftMouse>'] = 'open',
['<cr>'] = 'open',
['<esc>'] = 'revert_preview',
['P'] = { 'toggle_preview', config = { use_float = true } },
['S'] = 'open_split',
['s'] = 'open_vsplit',
-- ["S"] = "split_with_window_picker",
-- ["s"] = "vsplit_with_window_picker",
['t'] = 'open_tabnew',
-- ["<cr>"] = "open_drop",
-- ["t"] = "open_tab_drop",
['w'] = 'open_with_window_picker',
--["P"] = "toggle_preview", -- enter preview mode, which shows the current node without focusing
['C'] = 'close_node',
['z'] = 'close_all_nodes',
--["Z"] = "expand_all_nodes",
['a'] = {
'add',
-- some commands may take optional config options, see `:h neo-tree-mappings` for details
config = {
show_path = 'none' -- "none", "relative", "absolute"
}
},
['A'] = 'add_directory', -- also accepts the optional config.show_path option like "add".
['d'] = 'delete',
['r'] = 'rename',
['y'] = 'copy_to_clipboard',
['x'] = 'cut_to_clipboard',
['p'] = 'paste_from_clipboard',
['c'] = 'copy', -- takes text input for destination, also accepts the optional config.show_path option like "add":
-- ["c"] = {
-- "copy",
-- config = {
-- show_path = "none" -- "none", "relative", "absolute"
-- }
--}
['m'] = 'move', -- takes text input for destination, also accepts the optional config.show_path option like "add".
['q'] = 'close_window',
['R'] = 'refresh',
['?'] = 'show_help',
['<'] = 'prev_source',
['>'] = 'next_source',
}
},
nesting_rules = {},
filesystem = {
filtered_items = {
visible = false, -- 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"
},
hide_by_pattern = { -- uses glob style patterns
--"*.meta",
--"*/src/*/tsconfig.json",
},
always_show = { -- remains visible even if other settings would normally hide it
'.config',
--".gitignored",
},
never_show = { -- remains hidden even if visible is toggled to true, this overrides always_show
--".DS_Store",
--"thumbs.db"
},
never_show_by_pattern = { -- uses glob style patterns
'.null-ls_*',
},
},
follow_current_file = false, -- This will find and focus the file in the active buffer every
-- time the current file is changed while the tree is open.
group_empty_dirs = false, -- when true, empty folders will be grouped together
hijack_netrw_behavior = 'open_default', -- netrw disabled, opening a directory opens neo-tree
-- in whatever position is specified in window.position
-- "open_current", -- netrw disabled, opening a directory opens within the
-- window like netrw would, regardless of window.position
-- "disabled", -- netrw left alone, neo-tree does not handle opening dirs
use_libuv_file_watcher = true, -- This will use the OS level file watchers to detect changes
-- instead of relying on nvim autocmd events.
window = {
mappings = {
['<bs>'] = 'navigate_up',
['.'] = 'set_root',
['H'] = 'toggle_hidden',
['/'] = 'noop',
['D'] = 'fuzzy_finder_directory',
['f'] = 'filter_on_submit',
['<c-x>'] = 'clear_filter',
['[g'] = 'prev_git_modified',
[']g'] = 'next_git_modified',
}
}
},
buffers = {
follow_current_file = true, -- This will find and focus the file in the active buffer every
-- time the current file is changed while the tree is open.
group_empty_dirs = true, -- when true, empty folders will be grouped together
show_unloaded = true,
window = {
mappings = {
['bd'] = 'buffer_delete',
['<bs>'] = 'navigate_up',
['.'] = 'set_root',
}
},
},
git_status = {
window = {
position = 'float',
mappings = {
['A'] = 'git_add_all',
['gu'] = 'git_unstage_file',
['ga'] = 'git_add_file',
['gr'] = 'git_revert_file',
['gc'] = 'git_commit',
['gp'] = 'git_push',
['gg'] = 'git_commit_and_push',
}
}
}
})
vim.api.nvim_set_keymap('n', '<F3>', [[<Cmd>Neotree toggle<CR>]], {}) vim.api.nvim_set_keymap('n', '<F3>', [[<Cmd>Neotree toggle<CR>]], {})
vim.api.nvim_set_keymap('n', '<F4>', [[<Cmd>Neotree reveal<CR>]], {}) vim.api.nvim_set_keymap('n', '<F4>', [[<Cmd>Neotree reveal<CR>]], {})
vim.api.nvim_set_keymap('n', '<Space>G', [[<Cmd>Neotree git_status<CR>]], {}) vim.api.nvim_set_keymap('n', '<Space>G', [[<Cmd>Neotree git_status<CR>]], {})
end end
return M return M

View file

@ -1,7 +1,7 @@
local M = {} local M = {}
function M.setup() function M.setup()
local nls = require "null-ls" local nls = require 'null-ls'
nls.setup({ nls.setup({
debug = false, debug = false,
@ -12,11 +12,11 @@ function M.setup()
nls.builtins.diagnostics.phpstan.with({ nls.builtins.diagnostics.phpstan.with({
cwd = function(params) cwd = function(params)
-- falls back to root if return value is nil -- falls back to root if return value is nil
return params.root:match("jopixel") and not params.root:match("repo") and "www"; return params.root:match('jopixel') and not params.root:match('repo') and 'www';
end end
}), }),
nls.builtins.formatting.phpcsfixer.with({ nls.builtins.formatting.phpcsfixer.with({
extra_args = { "--rules", [[ { extra_args = { '--rules', [[ {
"@Symfony":true, "@Symfony":true,
"nullable_type_declaration_for_default_null_value":true, "nullable_type_declaration_for_default_null_value":true,
"array_syntax":{"syntax":"short"}, "array_syntax":{"syntax":"short"},

View file

@ -1,36 +1,36 @@
local M = {} local M = {}
function M.setup() function M.setup()
local cmp = require 'cmp' local cmp = require 'cmp'
cmp.setup({ cmp.setup({
-- documentation = true, -- documentation = true,
sources = { sources = {
{ name = 'nvim_lsp' }, { name = 'nvim_lsp' },
{ name = 'nvim_lua' }, { name = 'nvim_lua' },
{ name = 'buffer' }, { name = 'buffer' },
{ name = 'path' }, { name = 'path' },
-- { name = 'nvim_lsp_signature_help' }, -- { name = 'nvim_lsp_signature_help' },
}, },
formatting = { formatting = {
format = require 'lspkind'.cmp_format({ format = require 'lspkind'.cmp_format({
-- mode = 'symbol', -- mode = 'symbol',
}), }),
}, },
window = { window = {
-- completion = cmp.config.window.bordered(), -- completion = cmp.config.window.bordered(),
-- documentation = cmp.config.window.bordered(), -- documentation = cmp.config.window.bordered(),
}, },
mapping = cmp.mapping.preset.insert({ mapping = cmp.mapping.preset.insert({
['<CR>'] = cmp.mapping.confirm({ select = false }) ['<CR>'] = cmp.mapping.confirm({ select = false })
}), }),
snippet = { snippet = {
expand = function(args) expand = function(args)
-- For `vsnip` user. -- For `vsnip` user.
vim.fn["vsnip#anonymous"](args.body) -- For `vsnip` user. vim.fn['vsnip#anonymous'](args.body) -- For `vsnip` user.
end end
} }
}) })
end end
return M return M

View file

@ -1,33 +1,33 @@
local M = {} local M = {}
function M.setup() function M.setup()
require('nvim-tree').setup({ require('nvim-tree').setup({
sync_root_with_cwd = true, sync_root_with_cwd = true,
renderer = { renderer = {
add_trailing = true, add_trailing = true,
special_files = {}, special_files = {},
highlight_git = true, highlight_git = true,
indent_markers = { indent_markers = {
enable = true, enable = true,
}, },
icons = { icons = {
show = { show = {
file = false, file = false,
folder = false, folder = false,
folder_arrow = false, folder_arrow = false,
git = false git = false
} }
}, },
}, },
git = { git = {
ignore = true ignore = true
}, },
filters = { filters = {
dotfiles = true, dotfiles = true,
}, },
}) })
vim.api.nvim_set_keymap('n', '<F3>', [[<Cmd>NvimTreeToggle<CR>]], {}) vim.api.nvim_set_keymap('n', '<F3>', [[<Cmd>NvimTreeToggle<CR>]], {})
vim.api.nvim_set_keymap('n', '<F4>', [[<Cmd>NvimTreeFindFile<CR>]], {}) vim.api.nvim_set_keymap('n', '<F4>', [[<Cmd>NvimTreeFindFile<CR>]], {})
end end
return M return M

View file

@ -1,40 +1,41 @@
local M = {} local M = {}
function M.setup() function M.setup()
vim.o.ruler = true --vim.o.colorcolumn=0
vim.o.mouse = '' vim.o.autoindent = true
vim.o.showcmd = true vim.o.autoread = true
vim.o.scrolloff = 3 vim.o.completeopt = 'menuone,noinsert,noselect'
vim.o.ignorecase = true vim.o.cursorline = true
vim.o.smartcase = true vim.o.expandtab = true
vim.o.incsearch = true vim.o.fileencodings = 'ucs-bom,utf-8,default,windows-1250,cp852'
vim.o.inccommand = 'split' vim.o.foldcolumn = 'auto:1'
vim.o.hidden = true vim.o.foldenable = true
vim.o.autoread = true vim.o.foldmethod = 'marker'
vim.o.completeopt = 'menuone,noinsert,noselect' vim.o.foldopen = 'hor,mark,percent,quickfix,search,tag,undo'
vim.o.tabstop = 4 vim.o.hidden = true
vim.o.softtabstop = 4 vim.o.ignorecase = true
vim.o.swapfile = true vim.o.inccommand = 'split'
vim.o.undofile = true vim.o.incsearch = true
vim.o.expandtab = true vim.o.list = false
vim.o.shiftwidth = 4 vim.o.mouse = ''
vim.o.number = true vim.o.number = true
--vim.o.colorcolumn=0 vim.o.path = '**'
vim.o.foldmethod='marker' vim.o.relativenumber = false
vim.o.foldcolumn = 'auto:1' vim.o.ruler = true
vim.o.signcolumn = 'yes' vim.o.scrolloff = 3
vim.o.list = false vim.o.shiftwidth = 4
vim.o.relativenumber = false vim.o.showcmd = true
vim.o.foldenable = true vim.o.signcolumn = 'yes'
vim.o.cursorline = true vim.o.smartcase = true
vim.o.autoindent = true vim.o.smartindent = true
vim.o.smartindent = true vim.o.softtabstop = 4
vim.o.fileencodings = 'ucs-bom,utf-8,default,windows-1250,cp852' vim.o.swapfile = true
vim.o.path = '**' vim.o.tabstop = 4
--vim.o.clipboard = "unnamedplus" vim.o.undofile = true
--vim.o.clipboard = "unnamedplus"
-- Buffer -- Buffer
vim.cmd([[ vim.cmd([[
augroup forceRecheck augroup forceRecheck
au FocusGained,BufEnter * :silent! ! au FocusGained,BufEnter * :silent! !
augroup END augroup END

View file

@ -26,15 +26,19 @@ function M.setup()
use { use {
'neovim/nvim-lspconfig', 'neovim/nvim-lspconfig',
config = function() require("configs.lsp").setup() end, config = function() require('configs.lsp').setup() end,
requires = { 'b0o/schemastore.nvim' } requires = { 'b0o/schemastore.nvim' }
} }
use { 'hrsh7th/nvim-cmp', requires = { 'neovim/nvim-lspconfig' }, config = require("configs.nvim-cmp").setup } use { 'hrsh7th/nvim-cmp', requires = { 'neovim/nvim-lspconfig' }, config = require('configs.nvim-cmp').setup }
use { 'hrsh7th/cmp-nvim-lsp', requires = { 'hrsh7th/nvim-cmp' } } use { 'hrsh7th/cmp-nvim-lsp', requires = { 'hrsh7th/nvim-cmp' } }
use { 'hrsh7th/cmp-buffer', requires = { 'hrsh7th/nvim-cmp' } } use { 'hrsh7th/cmp-buffer', requires = { 'hrsh7th/nvim-cmp' } }
use { 'hrsh7th/cmp-path', requires = { 'hrsh7th/nvim-cmp' } } use { 'hrsh7th/cmp-path', requires = { 'hrsh7th/nvim-cmp' } }
use { 'hrsh7th/cmp-nvim-lua', requires = { 'hrsh7th/nvim-cmp' } } use { 'hrsh7th/cmp-nvim-lua', requires = { 'hrsh7th/nvim-cmp' } }
use 'hrsh7th/vim-vsnip' use { 'hrsh7th/vim-vsnip', config = function()
vim.keymap.set({ 'i', 's' }, '<Tab>', [[vsnip#jumpable(1) ? '<Plug>(vsnip-jump-next)' : <Tab>]], { expr = true })
vim.keymap.set({ 'i', 's' }, '<S-Tab>', [[vsnip#jumpable(-1) ? '<Plug>(vsnip-jump-prev)' : <S-Tab>]], { expr = true })
end }
use 'hrsh7th/cmp-nvim-lsp-signature-help' use 'hrsh7th/cmp-nvim-lsp-signature-help'
use { 'hrsh7th/cmp-vsnip', requires = { 'hrsh7th/nvim-cmp', 'hrsh7th/vim-vsnip' } } use { 'hrsh7th/cmp-vsnip', requires = { 'hrsh7th/nvim-cmp', 'hrsh7th/vim-vsnip' } }
@ -44,21 +48,27 @@ function M.setup()
-- use { 'weilbith/nvim-code-action-menu', cmd = 'CodeActionMenu' } -- use { 'weilbith/nvim-code-action-menu', cmd = 'CodeActionMenu' }
-- use { 'simrat39/symbols-outline.nvim', cmd = 'SymbolsOutline' } -- use { 'simrat39/symbols-outline.nvim', cmd = 'SymbolsOutline' }
use { 'stevearc/dressing.nvim' } use { 'stevearc/dressing.nvim', config = function()
require('dressing').setup({
input = {
relative = 'editor',
},
})
end }
use { 'jose-elias-alvarez/null-ls.nvim', requires = { "nvim-lua/plenary.nvim" }, use { 'jose-elias-alvarez/null-ls.nvim', requires = { 'nvim-lua/plenary.nvim' },
config = require("configs.null-ls").setup } config = require('configs.null-ls').setup }
use { 'nvim-treesitter/nvim-treesitter', use { 'nvim-treesitter/nvim-treesitter',
run = ':TSUpdate', run = ':TSUpdate',
config = require("configs.treesitter").setup, config = require('configs.treesitter').setup,
} }
use 'nvim-treesitter/playground' use 'nvim-treesitter/playground'
use({ "yioneko/nvim-yati", requires = "nvim-treesitter/nvim-treesitter" }) use({ 'yioneko/nvim-yati', requires = 'nvim-treesitter/nvim-treesitter' })
use { 'nvim-telescope/telescope.nvim', use { 'nvim-telescope/telescope.nvim',
requires = { 'nvim-lua/popup.nvim', 'nvim-lua/plenary.nvim' }, requires = { 'nvim-lua/popup.nvim', 'nvim-lua/plenary.nvim' },
config = require("configs.telescope").setup, config = require('configs.telescope').setup,
} }
use { 'nvim-telescope/telescope-fzf-native.nvim', use { 'nvim-telescope/telescope-fzf-native.nvim',
run = 'cmake -S. -Bbuild -DCMAKE_BUILD_TYPE=Release && cmake --build build --config Release && cmake --install build --prefix build' run = 'cmake -S. -Bbuild -DCMAKE_BUILD_TYPE=Release && cmake --build build --config Release && cmake --install build --prefix build'
@ -68,8 +78,8 @@ function M.setup()
use { 'chrisbra/Colorizer', cmd = 'ColorToggle', keys = { 'n', '<space>c <Cmd>ColorToggle<CR>' } } use { 'chrisbra/Colorizer', cmd = 'ColorToggle', keys = { 'n', '<space>c <Cmd>ColorToggle<CR>' } }
use { "numToStr/FTerm.nvim", use { 'numToStr/FTerm.nvim',
config = require("configs.fterm").setup config = require('configs.fterm').setup
} }
use { 'lewis6991/gitsigns.nvim', use { 'lewis6991/gitsigns.nvim',
@ -78,7 +88,7 @@ function M.setup()
use { 'hoob3rt/lualine.nvim', use { 'hoob3rt/lualine.nvim',
requires = { 'kyazdani42/nvim-web-devicons' }, requires = { 'kyazdani42/nvim-web-devicons' },
config = require("configs.lualine").setup config = require('configs.lualine').setup
} }
use { 'AndrewRadev/linediff.vim', cmd = 'LineDiffAdd' } use { 'AndrewRadev/linediff.vim', cmd = 'LineDiffAdd' }
@ -87,7 +97,7 @@ function M.setup()
use { use {
'b3nj5m1n/kommentary', 'b3nj5m1n/kommentary',
config = function() require('kommentary.config').configure_language("php", config = function() require('kommentary.config').configure_language('php',
{ prefer_single_line_comments = true, }) { prefer_single_line_comments = true, })
end end
} }
@ -96,19 +106,19 @@ function M.setup()
use { use {
'kyazdani42/nvim-tree.lua', 'kyazdani42/nvim-tree.lua',
config = require("configs.nvimtree"), config = require('configs.nvimtree'),
disable = true, disable = true,
} }
use { use {
"nvim-neo-tree/neo-tree.nvim", 'nvim-neo-tree/neo-tree.nvim',
branch = "v2.x", branch = 'v2.x',
requires = { requires = {
"nvim-lua/plenary.nvim", 'nvim-lua/plenary.nvim',
"kyazdani42/nvim-web-devicons", -- not strictly required, but recommended 'kyazdani42/nvim-web-devicons', -- not strictly required, but recommended
"MunifTanjim/nui.nvim", 'MunifTanjim/nui.nvim',
}, },
config = require("configs.neotree").setup, config = require('configs.neotree').setup,
} }
use { use {
@ -128,7 +138,7 @@ function M.setup()
use { use {
'folke/trouble.nvim', 'folke/trouble.nvim',
requires = "kyazdani42/nvim-web-devicons", requires = 'kyazdani42/nvim-web-devicons',
cmd = 'TroubleToggle', cmd = 'TroubleToggle',
keys = { 'n', '<space>t <Cmd>TroubleToggle<CR>' }, keys = { 'n', '<space>t <Cmd>TroubleToggle<CR>' },
config = function() require('trouble').setup({ config = function() require('trouble').setup({

View file

@ -1,16 +1,16 @@
local M = {} local M = {}
function M.setup() function M.setup()
vim.api.nvim_set_keymap('n', '<Space>b', [[<Cmd>Telescope buffers<CR>]], { noremap = true, silent = true }) vim.api.nvim_set_keymap('n', '<Space>b', [[<Cmd>Telescope buffers<CR>]], { noremap = true, silent = true })
vim.api.nvim_set_keymap('n', '<Space>f', [[<Cmd>Telescope fd<CR>]], { noremap = true, silent = true }) vim.api.nvim_set_keymap('n', '<Space>f', [[<Cmd>Telescope fd<CR>]], { noremap = true, silent = true })
vim.api.nvim_set_keymap('n', '<Space>T', [[<Cmd>Telescope<CR>]], { noremap = true, silent = true }) vim.api.nvim_set_keymap('n', '<Space>T', [[<Cmd>Telescope<CR>]], { noremap = true, silent = true })
require("telescope").setup { require('telescope').setup {
defaults = { defaults = {
preview = { preview = {
hide_on_startup = true hide_on_startup = true
}, },
--[[ mappings = { --[[ mappings = {
i = { i = {
["<c-h>"] = actions.toggle_preview, ["<c-h>"] = actions.toggle_preview,
}, },
@ -18,33 +18,33 @@ n = {
["<c-h>"] = actions.toggle_preview, ["<c-h>"] = actions.toggle_preview,
}, },
}, ]] }, ]]
}, },
pickers = { pickers = {
buffers = { buffers = {
show_all_buffers = true, show_all_buffers = true,
sort_lastused = false, sort_lastused = false,
sort_mru = true, sort_mru = true,
-- theme = "dropdown", -- theme = "dropdown",
mappings = { mappings = {
i = { ["<c-d>"] = "delete_buffer", }, i = { ['<c-d>'] = 'delete_buffer', },
n = { ["<c-d>"] = "delete_buffer", } n = { ['<c-d>'] = 'delete_buffer', }
}
}
} }
}
} }
}
require('telescope').load_extension('fzf') require('telescope').load_extension('fzf')
--[[ local telescope_ag = vim.api.nvim_create_augroup('Telescope') --[[ local telescope_ag = vim.api.nvim_create_augroup('Telescope')
nvim.nvim_create_autocmd('FileType', { pattern='TelescopePrompt', command = nvim.nvim_buf_set_keymap('n', '' ]] nvim.nvim_create_autocmd('FileType', { pattern='TelescopePrompt', command = nvim.nvim_buf_set_keymap('n', '' ]]
vim.cmd 'augroup Telescope' vim.cmd 'augroup Telescope'
vim.cmd 'autocmd FileType TelescopePrompt inoremap <buffer> <C-b> <cmd>Telescope buffers initial_mode=insert<cr>' vim.cmd 'autocmd FileType TelescopePrompt inoremap <buffer> <C-b> <cmd>Telescope buffers initial_mode=insert<cr>'
vim.cmd 'autocmd FileType TelescopePrompt inoremap <buffer> <C-f> <cmd>Telescope fd initial_mode=insert<cr>' vim.cmd 'autocmd FileType TelescopePrompt inoremap <buffer> <C-f> <cmd>Telescope fd initial_mode=insert<cr>'
vim.cmd 'autocmd FileType TelescopePrompt nnoremap <buffer> <C-b> <cmd>Telescope buffers initial_mode=insert<cr>' vim.cmd 'autocmd FileType TelescopePrompt nnoremap <buffer> <C-b> <cmd>Telescope buffers initial_mode=insert<cr>'
vim.cmd 'autocmd FileType TelescopePrompt nnoremap <buffer> <C-f> <cmd>Telescope fd initial_mode=insert<cr>' vim.cmd 'autocmd FileType TelescopePrompt nnoremap <buffer> <C-f> <cmd>Telescope fd initial_mode=insert<cr>'
vim.cmd 'autocmd FileType TelescopePrompt inoremap <buffer> <C-a> <cmd>Telescope builtin initial_mode=insert<cr>' vim.cmd 'autocmd FileType TelescopePrompt inoremap <buffer> <C-a> <cmd>Telescope builtin initial_mode=insert<cr>'
vim.cmd 'autocmd FileType TelescopePrompt nnoremap <buffer> <C-a> <cmd>Telescope builtin initial_mode=insert<cr>' vim.cmd 'autocmd FileType TelescopePrompt nnoremap <buffer> <C-a> <cmd>Telescope builtin initial_mode=insert<cr>'
vim.cmd 'augroup END' vim.cmd 'augroup END'
end end

View file

@ -5,17 +5,17 @@ function M.setup()
ensure_installed = 'all', -- one of "all", "maintained" (parsers with maintainers), or a list of languages ensure_installed = 'all', -- one of "all", "maintained" (parsers with maintainers), or a list of languages
highlight = { highlight = {
enable = true, enable = true,
disable = { "help" }, disable = { 'help' },
}, },
playground = { enable = true, }, playground = { enable = true, },
yati = { enable = true, }, yati = { enable = true, },
incremental_selection = { incremental_selection = {
enable = true, enable = true,
keymaps = { keymaps = {
init_selection = "gnn", init_selection = 'gnn',
node_incremental = "+", node_incremental = '+',
scope_incremental = "grc", scope_incremental = 'grc',
node_decremental = "-", node_decremental = '-',
}, },
}, },
indent = { indent = {
@ -27,14 +27,14 @@ function M.setup()
local ts_parsers = require 'nvim-treesitter.parsers'.get_parser_configs() local ts_parsers = require 'nvim-treesitter.parsers'.get_parser_configs()
ts_parsers.xml = { ts_parsers.xml = {
install_info = { install_info = {
url = "https://github.com/dorgnarg/tree-sitter-xml", -- local path or git repo url = 'https://github.com/dorgnarg/tree-sitter-xml', -- local path or git repo
files = { "src/parser.c" }, files = { 'src/parser.c' },
-- optional entries: -- optional entries:
branch = "main", -- default branch in case of git repo if different from master branch = 'main', -- default branch in case of git repo if different from master
generate_requires_npm = false, -- if stand-alone parser without npm dependencies generate_requires_npm = false, -- if stand-alone parser without npm dependencies
requires_generate_from_grammar = true, -- if folder contains pre-generated src/parser.c requires_generate_from_grammar = true, -- if folder contains pre-generated src/parser.c
}, },
filetype = "xml", -- if filetype does not match the parser name filetype = 'xml', -- if filetype does not match the parser name
} }
end end

View file

@ -911,6 +911,7 @@ extension=pgsql.so
extension=pdo_mysql.so extension=pdo_mysql.so
extension=pdo_pgsql.so extension=pdo_pgsql.so
extension=pdo_sqlite.so extension=pdo_sqlite.so
extension=pdo_firebird.so
extension=phar.so extension=phar.so
extension=posix.so extension=posix.so
extension=simplexml.so extension=simplexml.so