mirror of
https://github.com/ivuorinen/dotfiles.git
synced 2026-02-01 16:47:40 +00:00
Compare commits
4 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
4cf956aa17 | ||
|
|
f9142a4780 | ||
|
|
bb921189e2 | ||
| a4eb0b0186 |
@@ -3,27 +3,10 @@ root = true
|
|||||||
[*]
|
[*]
|
||||||
charset = utf-8
|
charset = utf-8
|
||||||
end_of_line = lf
|
end_of_line = lf
|
||||||
# indent_size = 4
|
indent_size = 2
|
||||||
indent_style = space
|
indent_style = space
|
||||||
insert_final_newline = true
|
insert_final_newline = true
|
||||||
# max_line_length = 160
|
|
||||||
# tab_width = 4
|
|
||||||
trim_trailing_whitespace = true
|
trim_trailing_whitespace = true
|
||||||
|
|
||||||
[{*.yaml,*.yml}]
|
|
||||||
indent_size = 2
|
|
||||||
|
|
||||||
[*.sh]
|
|
||||||
indent_size = 2
|
|
||||||
tab_width = 2
|
|
||||||
|
|
||||||
shell_variant = bash # like -ln=posix
|
|
||||||
binary_next_line = true # like -bn
|
|
||||||
switch_case_indent = true # like -ci
|
|
||||||
space_redirects = true # like -sr
|
|
||||||
keep_padding = false # like -kp
|
|
||||||
function_next_line = true # like -fn
|
|
||||||
never_split = false # like -ns
|
|
||||||
|
|
||||||
[local/bin/antigen.zsh]
|
[local/bin/antigen.zsh]
|
||||||
ignore = true
|
ignore = true
|
||||||
|
|||||||
11
config/alias
11
config/alias
@@ -58,18 +58,17 @@ alias zapds='find . -name ".DS_Store" -print -delete'
|
|||||||
alias t='tail -f' # tail with follow flag on
|
alias t='tail -f' # tail with follow flag on
|
||||||
alias dn='du -chd1' # directory usage, return only the total
|
alias dn='du -chd1' # directory usage, return only the total
|
||||||
|
|
||||||
alias code_scanner='docker run \
|
alias code_scanner="docker run \
|
||||||
--env SOURCE_CODE="$PWD" \
|
--env SOURCE_CODE='${PWD}' \
|
||||||
--volume "$PWD":/code \
|
--volume '${PWD}':/code \
|
||||||
--volume /var/run/docker.sock:/var/run/docker.sock \
|
--volume /var/run/docker.sock:/var/run/docker.sock \
|
||||||
registry.gitlab.com/gitlab-org/ci-cd/codequality:${CODEQUALITY_VERSION:-latest} \
|
registry.gitlab.com/gitlab-org/ci-cd/codequality:${CODEQUALITY_VERSION:-latest} \
|
||||||
/code'
|
/code"
|
||||||
|
|
||||||
alias composerUp='composer global update'
|
alias composerUp='composer global update'
|
||||||
alias npmUp='npm -g up'
|
alias npmUp='npm -g up'
|
||||||
|
|
||||||
alias zedit='$EDITOR ~/.zshrc ~/.alias'
|
alias zedit='$EDITOR ~/.dotfiles'
|
||||||
alias zdots='$EDITOR ~/.dotfiles'
|
|
||||||
|
|
||||||
if [[ -f "$HOME/.aliases.local" ]]; then
|
if [[ -f "$HOME/.aliases.local" ]]; then
|
||||||
# shellcheck disable=SC1091
|
# shellcheck disable=SC1091
|
||||||
|
|||||||
@@ -66,14 +66,12 @@ require('packer').startup(function(use)
|
|||||||
|
|
||||||
-- Fuzzy Finder (files, lsp, etc)
|
-- Fuzzy Finder (files, lsp, etc)
|
||||||
use { 'nvim-telescope/telescope.nvim',
|
use { 'nvim-telescope/telescope.nvim',
|
||||||
branch = '0.1.x',
|
branch = '0.1.x', requires = { 'nvim-lua/plenary.nvim' } }
|
||||||
requires = { 'nvim-lua/plenary.nvim' }
|
|
||||||
}
|
|
||||||
|
|
||||||
-- Fuzzy Finder Algorithm which requires local dependencies to be built.
|
-- Fuzzy Finder Algorithm which requires local dependencies to be built.
|
||||||
-- Only load if `make` is available
|
-- Only load if `make` is available
|
||||||
use { 'nvim-telescope/telescope-fzf-native.nvim',
|
use { 'nvim-telescope/telescope-fzf-native.nvim',
|
||||||
run = 'make', cond = vim.fn.executable 'make' == 1 }
|
run = 'make', cond = vim.fn.executable 'make' == 1 }
|
||||||
|
|
||||||
-- Add custom plugins to packer from
|
-- Add custom plugins to packer from
|
||||||
-- ~/.config/nvim/lua/custom/plugins.lua
|
-- ~/.config/nvim/lua/custom/plugins.lua
|
||||||
@@ -106,7 +104,13 @@ local packer_group = vim.api.nvim_create_augroup('Packer', { clear = true })
|
|||||||
vim.api.nvim_create_autocmd('BufWritePost', {
|
vim.api.nvim_create_autocmd('BufWritePost', {
|
||||||
command = 'source <afile> | PackerCompile',
|
command = 'source <afile> | PackerCompile',
|
||||||
group = packer_group,
|
group = packer_group,
|
||||||
pattern = { vim.fn.expand '$MYVIMRC', '~/.dotfiles/config/nvim/**/*.lua' },
|
pattern = { vim.fn.expand '$MYVIMRC' },
|
||||||
|
})
|
||||||
|
-- Automatically run PackerSync for plugins.lua files.
|
||||||
|
vim.api.nvim_create_autocmd('BufWritePost', {
|
||||||
|
command = 'source <afile> | PackerSync | PackerCompile',
|
||||||
|
group = packer_group,
|
||||||
|
pattern = { '~/.dotfiles/config/nvim/**/plugins.lua' },
|
||||||
})
|
})
|
||||||
|
|
||||||
-- [[ Setting options ]]
|
-- [[ Setting options ]]
|
||||||
@@ -115,7 +119,7 @@ vim.api.nvim_create_autocmd('BufWritePost', {
|
|||||||
-- Set highlight on search
|
-- Set highlight on search
|
||||||
vim.o.hlsearch = false
|
vim.o.hlsearch = false
|
||||||
|
|
||||||
-- Make line numbers default, enabled relative linenumbers
|
-- Make line numbers default, enabled relative line numbers
|
||||||
vim.wo.number = true
|
vim.wo.number = true
|
||||||
vim.opt.relativenumber = true
|
vim.opt.relativenumber = true
|
||||||
|
|
||||||
@@ -154,7 +158,7 @@ vim.o.winbar = '%=%m %f'
|
|||||||
-- [[ Basic Keymaps ]]
|
-- [[ Basic Keymaps ]]
|
||||||
-- Set <space> as the leader key
|
-- Set <space> as the leader key
|
||||||
-- See `:help mapleader`
|
-- See `:help mapleader`
|
||||||
-- NOTE: Must happen before plugins are required
|
-- NOTE: Must happen before plugins are required
|
||||||
-- (otherwise wrong leader will be used)
|
-- (otherwise wrong leader will be used)
|
||||||
vim.g.mapleader = ' '
|
vim.g.mapleader = ' '
|
||||||
vim.g.maplocalleader = ' '
|
vim.g.maplocalleader = ' '
|
||||||
@@ -163,9 +167,145 @@ vim.g.maplocalleader = ' '
|
|||||||
-- See `:help vim.keymap.set()`
|
-- See `:help vim.keymap.set()`
|
||||||
vim.keymap.set({ 'n', 'v' }, '<Space>', '<Nop>', { silent = true })
|
vim.keymap.set({ 'n', 'v' }, '<Space>', '<Nop>', { silent = true })
|
||||||
|
|
||||||
-- Remap for dealing with word wrap
|
-- Misc options.
|
||||||
vim.keymap.set('n', 'k', "v:count == 0 ? 'gk' : 'k'", { expr = true, silent = true })
|
vim.o.incsearch = true
|
||||||
vim.keymap.set('n', 'j', "v:count == 0 ? 'gj' : 'j'", { expr = true, silent = true })
|
|
||||||
|
-- Keymap settings, etc.
|
||||||
|
-- ~/.config/nvim/lua/custom/keymaps.lua
|
||||||
|
local map = vim.api.nvim_set_keymap
|
||||||
|
local default_options_table = {
|
||||||
|
expr = true,
|
||||||
|
silent = true,
|
||||||
|
noremap = true,
|
||||||
|
}
|
||||||
|
|
||||||
|
-- normal mode keymap setter
|
||||||
|
---@param keys string Trigger keys
|
||||||
|
---@param func string Function or command to run
|
||||||
|
---@param opts table Optional table of vim.keymap.set options.
|
||||||
|
---@param desc string Optional description
|
||||||
|
local nmap = function(keys, func, opts, desc)
|
||||||
|
if desc then
|
||||||
|
desc = 'keymaps.nmap: ' .. desc
|
||||||
|
end
|
||||||
|
|
||||||
|
local options = default_options_table
|
||||||
|
|
||||||
|
-- If we have options, merge them to the local options table
|
||||||
|
if opts then
|
||||||
|
for k, v in pairs(opts) do
|
||||||
|
options[k] = v
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
vim.keymap.set('n', keys, func, options)
|
||||||
|
end
|
||||||
|
|
||||||
|
-- visual mode keymap setter
|
||||||
|
---@param keys string Trigger keys
|
||||||
|
---@param func string Function or command to run
|
||||||
|
---@param opts table Optional table of vim.keymap.set options.
|
||||||
|
---@param desc string Optional description
|
||||||
|
local vmap = function(keys, func, opts, desc)
|
||||||
|
if desc then
|
||||||
|
desc = 'keymaps.vmap: ' .. desc
|
||||||
|
end
|
||||||
|
|
||||||
|
local options = default_options_table
|
||||||
|
|
||||||
|
-- If we have options, merge them to the local options table
|
||||||
|
if opts then
|
||||||
|
for k, v in pairs(opts) do
|
||||||
|
options[k] = v
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
vim.keymap.set('v', keys, func, options)
|
||||||
|
end
|
||||||
|
|
||||||
|
-- Format document
|
||||||
|
nmap("<leader>D", ":Format")
|
||||||
|
|
||||||
|
-- Deal with word wrap
|
||||||
|
nmap('k', "v:count == 0 ? 'gk' : 'k'")
|
||||||
|
nmap('j', "v:count == 0 ? 'gj' : 'j'")
|
||||||
|
|
||||||
|
-- Diagnostic keymaps
|
||||||
|
nmap('dz', vim.diagnostic.goto_prev)
|
||||||
|
nmap('dx', vim.diagnostic.goto_next)
|
||||||
|
nmap('<leader>e', vim.diagnostic.open_float)
|
||||||
|
nmap('<leader>q', vim.diagnostic.setloclist)
|
||||||
|
|
||||||
|
--
|
||||||
|
-- ThePrimeagen/refactoring.nvim
|
||||||
|
-- https://github.com/ThePrimeagen/refactoring.nvim
|
||||||
|
--
|
||||||
|
|
||||||
|
-- Remaps for the refactoring operations currently offered by the plugin
|
||||||
|
local rf = { noremap = true, silent = true, expr = false }
|
||||||
|
vmap("<leader>re", [[ <Esc><Cmd>lua require('refactoring').refactor('Extract Function')<CR>]], rf)
|
||||||
|
vmap("<leader>rf", [[ <Esc><Cmd>lua require('refactoring').refactor('Extract Function To File')<CR>]], rf)
|
||||||
|
vmap("<leader>rv", [[ <Esc><Cmd>lua require('refactoring').refactor('Extract Variable')<CR>]], rf)
|
||||||
|
vmap("<leader>ri", [[ <Esc><Cmd>lua require('refactoring').refactor('Inline Variable')<CR>]], rf)
|
||||||
|
|
||||||
|
-- Extract block doesn't need visual mode
|
||||||
|
nmap("<leader>rb", [[ <Cmd>lua require('refactoring').refactor('Extract Block')<CR>]], rf)
|
||||||
|
nmap("<leader>rbf", [[ <Cmd>lua require('refactoring').refactor('Extract Block To File')<CR>]], rf)
|
||||||
|
|
||||||
|
-- Inline variable can also pick up the identifier currently under the cursor without visual mode
|
||||||
|
nmap("<leader>ri", [[ <Cmd>lua require('refactoring').refactor('Inline Variable')<CR>]], rf)
|
||||||
|
|
||||||
|
-- prompt for a refactor to apply when the remap is triggered
|
||||||
|
vmap("<leader>rr", ":lua require('refactoring').select_refactor()<CR>", rf)
|
||||||
|
|
||||||
|
--
|
||||||
|
--
|
||||||
|
--
|
||||||
|
|
||||||
|
-- barbar keymaps
|
||||||
|
local barbar_opts = { noremap = true, silent = true }
|
||||||
|
|
||||||
|
-- Move to previous/next
|
||||||
|
map('n', '<C-,>', '<Cmd>BufferPrevious<CR>', barbar_opts)
|
||||||
|
map('n', '<C-.>', '<Cmd>BufferNext<CR>', barbar_opts)
|
||||||
|
-- Re-order to previous/next
|
||||||
|
map('n', '<C-<>', '<Cmd>BufferMovePrevious<CR>', barbar_opts)
|
||||||
|
map('n', '<C->>', '<Cmd>BufferMoveNext<CR>', barbar_opts)
|
||||||
|
-- Goto buffer in position...
|
||||||
|
map('n', '<leader>b1', '<Cmd>BufferGoto 1<CR>', barbar_opts)
|
||||||
|
map('n', '<leader>b2', '<Cmd>BufferGoto 2<CR>', barbar_opts)
|
||||||
|
map('n', '<leader>b3', '<Cmd>BufferGoto 3<CR>', barbar_opts)
|
||||||
|
map('n', '<leader>b4', '<Cmd>BufferGoto 4<CR>', barbar_opts)
|
||||||
|
map('n', '<leader>b5', '<Cmd>BufferGoto 5<CR>', barbar_opts)
|
||||||
|
map('n', '<leader>b6', '<Cmd>BufferGoto 6<CR>', barbar_opts)
|
||||||
|
map('n', '<leader>b7', '<Cmd>BufferGoto 7<CR>', barbar_opts)
|
||||||
|
map('n', '<leader>b8', '<Cmd>BufferGoto 8<CR>', barbar_opts)
|
||||||
|
map('n', '<leader>b9', '<Cmd>BufferGoto 9<CR>', barbar_opts)
|
||||||
|
map('n', '<leader>b0', '<Cmd>BufferLast<CR>', barbar_opts)
|
||||||
|
-- Pin/unpin buffer
|
||||||
|
map('n', '<A-p>', '<Cmd>BufferPin<CR>', barbar_opts)
|
||||||
|
-- Close buffer
|
||||||
|
map('n', '<A-c>', '<Cmd>BufferClose<CR>', barbar_opts)
|
||||||
|
-- Wipeout buffer
|
||||||
|
-- :BufferWipeout
|
||||||
|
-- Close commands
|
||||||
|
-- :BufferCloseAllButCurrent
|
||||||
|
-- :BufferCloseAllButPinned
|
||||||
|
-- :BufferCloseAllButCurrentOrPinned
|
||||||
|
-- :BufferCloseBuffersLeft
|
||||||
|
-- :BufferCloseBuffersRight
|
||||||
|
-- Magic buffer-picking mode
|
||||||
|
map('n', '<C-p>', '<Cmd>BufferPick<CR>', barbar_opts)
|
||||||
|
-- Sort automatically by...
|
||||||
|
map('n', '<Space>bb', '<Cmd>BufferOrderByBufferNumber<CR>', barbar_opts)
|
||||||
|
map('n', '<Space>bd', '<Cmd>BufferOrderByDirectory<CR>', barbar_opts)
|
||||||
|
map('n', '<Space>bl', '<Cmd>BufferOrderByLanguage<CR>', barbar_opts)
|
||||||
|
map('n', '<Space>bw', '<Cmd>BufferOrderByWindowNumber<CR>', barbar_opts)
|
||||||
|
|
||||||
|
-- Other:
|
||||||
|
-- :BarbarEnable - enables barbar (enabled by default)
|
||||||
|
-- :BarbarDisable - very bad command, should never be used
|
||||||
|
|
||||||
|
|
||||||
local highlight_group = vim.api.nvim_create_augroup(
|
local highlight_group = vim.api.nvim_create_augroup(
|
||||||
'YankHighlight', { clear = true }
|
'YankHighlight', { clear = true }
|
||||||
@@ -230,34 +370,27 @@ require('telescope').setup {
|
|||||||
-- Enable telescope fzf native, if installed
|
-- Enable telescope fzf native, if installed
|
||||||
pcall(require('telescope').load_extension, 'fzf')
|
pcall(require('telescope').load_extension, 'fzf')
|
||||||
|
|
||||||
|
local ks = vim.keymap.set
|
||||||
|
local tl = require('telescope.builtin')
|
||||||
|
|
||||||
-- See `:help telescope.builtin`
|
-- See `:help telescope.builtin`
|
||||||
vim.keymap.set('n', '<leader>?', require('telescope.builtin').oldfiles,
|
ks('n', '<leader>?', tl.oldfiles, { desc = '[?] Find recently opened files' })
|
||||||
{ desc = '[?] Find recently opened files' })
|
ks('n', '<leader><space>', tl.buffers, { desc = '[ ] Find existing buffers' })
|
||||||
vim.keymap.set('n', '<leader><space>', require('telescope.builtin').buffers,
|
ks('n', '<leader>/', function()
|
||||||
{ desc = '[ ] Find existing buffers' })
|
|
||||||
vim.keymap.set('n', '<leader>/', function()
|
|
||||||
-- You can pass additional configuration to telescope to
|
-- You can pass additional configuration to telescope to
|
||||||
-- change theme, layout, etc.
|
-- change theme, layout, etc.
|
||||||
require('telescope.builtin').current_buffer_fuzzy_find(
|
tl.current_buffer_fuzzy_find(
|
||||||
require('telescope.themes').get_dropdown {
|
require('telescope.themes').get_dropdown {
|
||||||
winblend = 10,
|
winblend = 10,
|
||||||
previewer = false,
|
previewer = false,
|
||||||
})
|
})
|
||||||
end, { desc = '[/] Fuzzily search in current buffer]' })
|
end, { desc = '[/] Fuzzily search in current buffer]' })
|
||||||
|
|
||||||
vim.keymap.set('n', '<leader>sf', require('telescope.builtin').find_files,
|
ks('n', '<leader>sf', tl.find_files, { desc = '[S]earch [F]iles' })
|
||||||
{ desc = '[S]earch [F]iles' })
|
ks('n', '<leader>sh', tl.help_tags, { desc = '[S]earch [H]elp' })
|
||||||
vim.keymap.set('n', '<leader>sh', require('telescope.builtin').help_tags,
|
ks('n', '<leader>sw', tl.grep_string, { desc = '[S]earch current [W]ord' })
|
||||||
{ desc = '[S]earch [H]elp' })
|
ks('n', '<leader>sg', tl.live_grep, { desc = '[S]earch by [G]rep' })
|
||||||
vim.keymap.set('n', '<leader>sw', require('telescope.builtin').grep_string,
|
ks('n', '<leader>sd', tl.diagnostics, { desc = '[S]earch [D]iagnostics' })
|
||||||
{ desc = '[S]earch current [W]ord' })
|
|
||||||
vim.keymap.set('n', '<leader>sg', require('telescope.builtin').live_grep,
|
|
||||||
{ desc = '[S]earch by [G]rep' })
|
|
||||||
vim.keymap.set('n', '<leader>sd', require('telescope.builtin').diagnostics,
|
|
||||||
{ desc = '[S]earch [D]iagnostics' })
|
|
||||||
|
|
||||||
-- Load custom treesitter grammar for org filetype
|
|
||||||
require('orgmode').setup_ts_grammar()
|
|
||||||
|
|
||||||
-- [[ Configure Treesitter ]]
|
-- [[ Configure Treesitter ]]
|
||||||
-- See `:help nvim-treesitter`
|
-- See `:help nvim-treesitter`
|
||||||
@@ -287,7 +420,7 @@ require('nvim-treesitter.configs').setup {
|
|||||||
enable = true,
|
enable = true,
|
||||||
-- Required for spellcheck, some LaTex highlights and
|
-- Required for spellcheck, some LaTex highlights and
|
||||||
-- code block highlights that do not have ts grammar
|
-- code block highlights that do not have ts grammar
|
||||||
additional_vim_regex_highlighting = {'org'},
|
additional_vim_regex_highlighting = { 'org' },
|
||||||
},
|
},
|
||||||
|
|
||||||
indent = { enable = true, disable = { 'python' } },
|
indent = { enable = true, disable = { 'python' } },
|
||||||
@@ -349,20 +482,16 @@ require('nvim-treesitter.configs').setup {
|
|||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
|
-- Load custom treesitter grammar for org filetype
|
||||||
|
require('orgmode').setup_ts_grammar()
|
||||||
require('orgmode').setup({
|
require('orgmode').setup({
|
||||||
org_agenda_files = {
|
org_agenda_files = {
|
||||||
'~/Library/Mobile Documents/iCloud~md~obsidian/Documents/_nvalt/**/*',
|
vim.fn.expand '~/.local/share/_nvalt/**/*',
|
||||||
'~/.dotfiles/local/org/**/*'
|
vim.fn.expand '~/.dotfiles/local/org/**/*'
|
||||||
},
|
},
|
||||||
org_default_notes_file = '~/Library/Mobile Documents/iCloud~md~obsidian/Documents/_nvalt/refile.org',
|
org_default_notes_file = vim.fn.expand '~/.local/share/_nvalt/refile.org',
|
||||||
})
|
})
|
||||||
|
|
||||||
-- Diagnostic keymaps
|
|
||||||
vim.keymap.set('n', 'dz', vim.diagnostic.goto_prev)
|
|
||||||
vim.keymap.set('n', 'dx', vim.diagnostic.goto_next)
|
|
||||||
vim.keymap.set('n', '<leader>e', vim.diagnostic.open_float)
|
|
||||||
vim.keymap.set('n', '<leader>q', vim.diagnostic.setloclist)
|
|
||||||
|
|
||||||
-- LSP settings.
|
-- LSP settings.
|
||||||
-- This function gets run when an LSP connects to a particular buffer.
|
-- This function gets run when an LSP connects to a particular buffer.
|
||||||
local on_attach = function(_, bufnr)
|
local on_attach = function(_, bufnr)
|
||||||
@@ -374,7 +503,7 @@ local on_attach = function(_, bufnr)
|
|||||||
-- In this case, we create a function that lets us more
|
-- In this case, we create a function that lets us more
|
||||||
-- easily define mappings specific for LSP related items.
|
-- easily define mappings specific for LSP related items.
|
||||||
-- It sets the mode, buffer and description for us each time.
|
-- It sets the mode, buffer and description for us each time.
|
||||||
local nmap = function(keys, func, desc)
|
local nm = function(keys, func, desc)
|
||||||
if desc then
|
if desc then
|
||||||
desc = 'LSP: ' .. desc
|
desc = 'LSP: ' .. desc
|
||||||
end
|
end
|
||||||
@@ -382,31 +511,29 @@ local on_attach = function(_, bufnr)
|
|||||||
vim.keymap.set('n', keys, func, { buffer = bufnr, desc = desc })
|
vim.keymap.set('n', keys, func, { buffer = bufnr, desc = desc })
|
||||||
end
|
end
|
||||||
|
|
||||||
nmap('<leader>rn', vim.lsp.buf.rename, '[R]e[n]ame')
|
local t = require('telescope.builtin')
|
||||||
nmap('<leader>ca', vim.lsp.buf.code_action, '[C]ode [A]ction')
|
local vbuf = vim.lsp.buf
|
||||||
|
|
||||||
nmap('gd', vim.lsp.buf.definition, '[G]oto [D]efinition')
|
nm('<leader>rn', vbuf.rename, '[R]e[n]ame')
|
||||||
nmap('gr', require('telescope.builtin').lsp_references,
|
nm('<leader>ca', vbuf.code_action, '[C]ode [A]ction')
|
||||||
'[G]oto [R]eferences')
|
|
||||||
nmap('gI', vim.lsp.buf.implementation, '[G]oto [I]mplementation')
|
nm('gd', vbuf.definition, '[G]oto [D]efinition')
|
||||||
nmap('<leader>D', vim.lsp.buf.type_definition, 'Type [D]efinition')
|
nm('gr', t.lsp_references, '[G]oto [R]eferences')
|
||||||
nmap('<leader>ds', require('telescope.builtin').lsp_document_symbols,
|
nm('gI', vbuf.implementation, '[G]oto [I]mplementation')
|
||||||
'[D]ocument [S]ymbols')
|
nm('<leader>D', vbuf.type_definition, 'Type [D]efinition')
|
||||||
nmap('<leader>ws', require('telescope.builtin').lsp_dynamic_workspace_symbols,
|
nm('<leader>ds', t.lsp_document_symbols, '[D]ocument [S]ymbols')
|
||||||
'[W]orkspace [S]ymbols')
|
nm('<leader>ws', t.lsp_dynamic_workspace_symbols, '[W]orkspace [S]ymbols')
|
||||||
|
|
||||||
-- See `:help K` for why this keymap
|
-- See `:help K` for why this keymap
|
||||||
nmap('K', vim.lsp.buf.hover, 'Hover Documentation')
|
nm('K', vbuf.hover, 'Hover Documentation')
|
||||||
nmap('<C-k>', vim.lsp.buf.signature_help, 'Signature Documentation')
|
nm('<C-k>', vbuf.signature_help, 'Signature Documentation')
|
||||||
|
|
||||||
-- Lesser used LSP functionality
|
-- Lesser used LSP functionality
|
||||||
nmap('gD', vim.lsp.buf.declaration, '[G]oto [D]eclaration')
|
nm('gD', vbuf.declaration, '[G]oto [D]eclaration')
|
||||||
nmap('<leader>wa', vim.lsp.buf.add_workspace_folder,
|
nm('<leader>wa', vbuf.add_workspace_folder, '[W]orkspace [A]dd Folder')
|
||||||
'[W]orkspace [A]dd Folder')
|
nm('<leader>wr', vbuf.remove_workspace_folder, '[W]orkspace [R]emove Folder')
|
||||||
nmap('<leader>wr', vim.lsp.buf.remove_workspace_folder,
|
nm('<leader>wl', function()
|
||||||
'[W]orkspace [R]emove Folder')
|
print(vim.inspect(vbuf.list_workspace_folders()))
|
||||||
nmap('<leader>wl', function()
|
|
||||||
print(vim.inspect(vim.lsp.buf.list_workspace_folders()))
|
|
||||||
end, '[W]orkspace [L]ist Folders')
|
end, '[W]orkspace [L]ist Folders')
|
||||||
|
|
||||||
-- Create a command `:Format` local to the LSP buffer
|
-- Create a command `:Format` local to the LSP buffer
|
||||||
@@ -421,6 +548,7 @@ end
|
|||||||
|
|
||||||
-- Setup mason so it can manage external tooling
|
-- Setup mason so it can manage external tooling
|
||||||
require('mason').setup()
|
require('mason').setup()
|
||||||
|
require("null-ls").setup()
|
||||||
|
|
||||||
-- Enable the following language servers.
|
-- Enable the following language servers.
|
||||||
-- Feel free to add/remove any LSPs that you want here.
|
-- Feel free to add/remove any LSPs that you want here.
|
||||||
@@ -457,7 +585,6 @@ local servers = {
|
|||||||
'marksman', -- markdown
|
'marksman', -- markdown
|
||||||
-- n
|
-- n
|
||||||
-- o
|
-- o
|
||||||
'spectral', --openapi
|
|
||||||
-- p
|
-- p
|
||||||
'intelephense', 'phpactor', 'psalm',
|
'intelephense', 'phpactor', 'psalm',
|
||||||
'pyright',
|
'pyright',
|
||||||
@@ -490,7 +617,8 @@ require("mason-lspconfig").setup_handlers {
|
|||||||
-- The first entry (without a key) will be the default handler
|
-- The first entry (without a key) will be the default handler
|
||||||
-- and will be called for each installed server that doesn't have
|
-- and will be called for each installed server that doesn't have
|
||||||
-- a dedicated handler.
|
-- a dedicated handler.
|
||||||
function (server_name) -- default handler (optional)
|
function(server_name)
|
||||||
|
-- default handler (optional)
|
||||||
require("lspconfig")[server_name].setup {}
|
require("lspconfig")[server_name].setup {}
|
||||||
end,
|
end,
|
||||||
}
|
}
|
||||||
@@ -509,8 +637,7 @@ end
|
|||||||
-- Turn on lsp status information
|
-- Turn on lsp status information
|
||||||
require('fidget').setup()
|
require('fidget').setup()
|
||||||
|
|
||||||
-- Example custom configuration for lua
|
-- Example custom configuration for lua.
|
||||||
--
|
|
||||||
-- Make runtime files discoverable to the server
|
-- Make runtime files discoverable to the server
|
||||||
local runtime_path = vim.split(package.path, ';')
|
local runtime_path = vim.split(package.path, ';')
|
||||||
table.insert(runtime_path, 'lua/?.lua')
|
table.insert(runtime_path, 'lua/?.lua')
|
||||||
@@ -585,50 +712,7 @@ cmp.setup {
|
|||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
-- barbar keymaps
|
|
||||||
local map = vim.api.nvim_set_keymap
|
|
||||||
local opts = { noremap = true, silent = true }
|
|
||||||
|
|
||||||
-- Move to previous/next
|
|
||||||
map('n', '<C-,>', '<Cmd>BufferPrevious<CR>', opts)
|
|
||||||
map('n', '<C-.>', '<Cmd>BufferNext<CR>', opts)
|
|
||||||
-- Re-order to previous/next
|
|
||||||
map('n', '<C-<>', '<Cmd>BufferMovePrevious<CR>', opts)
|
|
||||||
map('n', '<C->>', '<Cmd>BufferMoveNext<CR>', opts)
|
|
||||||
-- Goto buffer in position...
|
|
||||||
map('n', '<A-1>', '<Cmd>BufferGoto 1<CR>', opts)
|
|
||||||
map('n', '<A-2>', '<Cmd>BufferGoto 2<CR>', opts)
|
|
||||||
map('n', '<A-3>', '<Cmd>BufferGoto 3<CR>', opts)
|
|
||||||
map('n', '<A-4>', '<Cmd>BufferGoto 4<CR>', opts)
|
|
||||||
map('n', '<A-5>', '<Cmd>BufferGoto 5<CR>', opts)
|
|
||||||
map('n', '<A-6>', '<Cmd>BufferGoto 6<CR>', opts)
|
|
||||||
map('n', '<A-7>', '<Cmd>BufferGoto 7<CR>', opts)
|
|
||||||
map('n', '<A-8>', '<Cmd>BufferGoto 8<CR>', opts)
|
|
||||||
map('n', '<A-9>', '<Cmd>BufferGoto 9<CR>', opts)
|
|
||||||
map('n', '<A-0>', '<Cmd>BufferLast<CR>', opts)
|
|
||||||
-- Pin/unpin buffer
|
|
||||||
map('n', '<A-p>', '<Cmd>BufferPin<CR>', opts)
|
|
||||||
-- Close buffer
|
|
||||||
map('n', '<A-c>', '<Cmd>BufferClose<CR>', opts)
|
|
||||||
-- Wipeout buffer
|
|
||||||
-- :BufferWipeout
|
|
||||||
-- Close commands
|
|
||||||
-- :BufferCloseAllButCurrent
|
|
||||||
-- :BufferCloseAllButPinned
|
|
||||||
-- :BufferCloseAllButCurrentOrPinned
|
|
||||||
-- :BufferCloseBuffersLeft
|
|
||||||
-- :BufferCloseBuffersRight
|
|
||||||
-- Magic buffer-picking mode
|
|
||||||
map('n', '<C-p>', '<Cmd>BufferPick<CR>', opts)
|
|
||||||
-- Sort automatically by...
|
|
||||||
map('n', '<Space>bb', '<Cmd>BufferOrderByBufferNumber<CR>', opts)
|
|
||||||
map('n', '<Space>bd', '<Cmd>BufferOrderByDirectory<CR>', opts)
|
|
||||||
map('n', '<Space>bl', '<Cmd>BufferOrderByLanguage<CR>', opts)
|
|
||||||
map('n', '<Space>bw', '<Cmd>BufferOrderByWindowNumber<CR>', opts)
|
|
||||||
|
|
||||||
-- Other:
|
|
||||||
-- :BarbarEnable - enables barbar (enabled by default)
|
|
||||||
-- :BarbarDisable - very bad command, should never be used
|
|
||||||
|
|
||||||
vim.api.nvim_create_autocmd("BufWritePost",
|
vim.api.nvim_create_autocmd("BufWritePost",
|
||||||
{ pattern = "plugins.lua", command = "source <afile> | PackerSync" })
|
{ pattern = "plugins.lua", command = "source <afile> | PackerSync" })
|
||||||
@@ -639,7 +723,7 @@ vim.api.nvim_create_autocmd("BufNewFile",
|
|||||||
-- Enable spell checking for certain file types
|
-- Enable spell checking for certain file types
|
||||||
vim.api.nvim_create_autocmd({ "BufRead", "BufNewFile" },
|
vim.api.nvim_create_autocmd({ "BufRead", "BufNewFile" },
|
||||||
{ pattern = { "*.txt", "*.md", "*.tex" },
|
{ pattern = { "*.txt", "*.md", "*.tex" },
|
||||||
command = "setlocal spell" })
|
command = "setlocal spell" })
|
||||||
|
|
||||||
-- The line beneath this is called `modeline`. See `:help modeline`
|
-- The line beneath this is called `modeline`. See `:help modeline`
|
||||||
-- vim: ts=2 sts=2 sw=2 et
|
-- vim: ts=2 sts=2 sw=2 et
|
||||||
|
|||||||
@@ -1,74 +1,200 @@
|
|||||||
return function(use)
|
return function(use)
|
||||||
|
|
||||||
-- 💥 Create key bindings that stick.
|
-- 💥 Create key bindings that stick.
|
||||||
-- WhichKey is a lua plugin that displays a popup with
|
-- WhichKey is a lua plugin that displays a popup with
|
||||||
-- possible keybindings of the command you started typing.
|
-- possible keybindings of the command you started typing.
|
||||||
use({ "folke/which-key.nvim", config = function() require("which-key").setup({}) end })
|
-- https://github.com/folke/which-key.nvim
|
||||||
|
use({
|
||||||
|
"folke/which-key.nvim",
|
||||||
|
config = function()
|
||||||
|
require("which-key").setup({})
|
||||||
|
end
|
||||||
|
})
|
||||||
|
|
||||||
-- 🍨 Soothing pastel theme for (Neo)vim
|
-- 🍨 Soothing pastel theme for (Neo)vim
|
||||||
-- https://github.com/catppuccin/nvim
|
-- https://github.com/catppuccin/nvim
|
||||||
-- use { "catppuccin/nvim", as = "catppuccin" }
|
-- use { "catppuccin/nvim", as = "catppuccin" }
|
||||||
-- vim.cmd.colorscheme('catppuccin-latte')
|
-- vim.cmd.colorscheme('catppuccin-latte')
|
||||||
|
|
||||||
-- markdown preview plugin for (neo)vim
|
-- markdown preview plugin for (neo)vim
|
||||||
-- https://github.com/iamcco/markdown-preview.nvim
|
-- https://github.com/iamcco/markdown-preview.nvim
|
||||||
use({ "iamcco/markdown-preview.nvim",
|
use({
|
||||||
run = function() vim.fn["mkdp#util#install"]() end,
|
"iamcco/markdown-preview.nvim",
|
||||||
})
|
run = function()
|
||||||
|
vim.fn["mkdp#util#install"]()
|
||||||
|
end,
|
||||||
|
})
|
||||||
|
|
||||||
-- The neovim tabline plugin.
|
-- The neovim tabline plugin.
|
||||||
-- https://github.com/romgrk/barbar.nvim
|
-- https://github.com/romgrk/barbar.nvim
|
||||||
use 'nvim-tree/nvim-web-devicons'
|
use 'nvim-tree/nvim-web-devicons'
|
||||||
use { 'romgrk/barbar.nvim', wants = 'nvim-web-devicons' }
|
use { 'romgrk/barbar.nvim', wants = 'nvim-web-devicons' }
|
||||||
|
|
||||||
-- Pretty UI
|
--
|
||||||
use 'stevearc/dressing.nvim' -- Neovim plugin to improve the default vim.ui interfaces
|
-- Pretty UI
|
||||||
use 'rcarriga/nvim-notify' -- A fancy, configurable, notification manager for NeoVim
|
--
|
||||||
use 'vigoux/notifier.nvim' -- Non-intrusive notification system for neovim
|
|
||||||
use { 'folke/todo-comments.nvim', -- ✅ Highlight, list and search todo comments in your projects
|
-- Neovim plugin to improve the default vim.ui interfaces
|
||||||
requires = 'nvim-lua/plenary.nvim',
|
use 'stevearc/dressing.nvim'
|
||||||
config = function() require('todo-comments').setup {} end,
|
-- A fancy, configurable, notification manager for NeoVim
|
||||||
|
use 'rcarriga/nvim-notify'
|
||||||
|
-- Non-intrusive notification system for neovim
|
||||||
|
use 'vigoux/notifier.nvim'
|
||||||
|
-- ✅ Highlight, list and search todo comments in your projects
|
||||||
|
use {
|
||||||
|
'folke/todo-comments.nvim',
|
||||||
|
requires = 'nvim-lua/plenary.nvim',
|
||||||
|
config = function()
|
||||||
|
require('todo-comments').setup {}
|
||||||
|
end,
|
||||||
|
}
|
||||||
|
|
||||||
|
-- The Refactoring library based off the Refactoring book by Martin Fowler
|
||||||
|
-- https://github.com/ThePrimeagen/refactoring.nvim
|
||||||
|
use {
|
||||||
|
"ThePrimeagen/refactoring.nvim",
|
||||||
|
requires = {
|
||||||
|
{ "nvim-lua/plenary.nvim" },
|
||||||
|
{ "nvim-treesitter/nvim-treesitter" }
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
-- The Refactoring library based off the Refactoring book by Martin Fowler
|
-- An asynchronous linter plugin for Neovim complementary to
|
||||||
-- https://github.com/ThePrimeagen/refactoring.nvim
|
-- the built-in Language Server Protocol support.
|
||||||
use {
|
-- https://github.com/mfussenegger/nvim-lint
|
||||||
"ThePrimeagen/refactoring.nvim",
|
use 'mfussenegger/nvim-lint'
|
||||||
requires = {
|
vim.api.nvim_create_autocmd({ "BufWritePost" }, {
|
||||||
{"nvim-lua/plenary.nvim"},
|
callback = function()
|
||||||
{"nvim-treesitter/nvim-treesitter"}
|
require("lint").try_lint()
|
||||||
|
end,
|
||||||
|
})
|
||||||
|
|
||||||
|
-- nvim orgmode, to get me use nvim even more.
|
||||||
|
use({
|
||||||
|
"nvim-orgmode/orgmode",
|
||||||
|
config = function()
|
||||||
|
require('orgmode').setup_ts_grammar()
|
||||||
|
end,
|
||||||
|
})
|
||||||
|
|
||||||
|
-- Markdown support
|
||||||
|
use 'preservim/vim-markdown'
|
||||||
|
use 'godlygeek/tabular'
|
||||||
|
|
||||||
|
-- obsidian plugin for nvim
|
||||||
|
-- https://github.com/epwalsh/obsidian.nvim
|
||||||
|
use({
|
||||||
|
"epwalsh/obsidian.nvim",
|
||||||
|
config = function()
|
||||||
|
require("obsidian").setup({
|
||||||
|
dir = '~/.local/share/_nvalt',
|
||||||
|
notes_subdir = "notes",
|
||||||
|
daily_notes = {
|
||||||
|
folder = "_daily"
|
||||||
|
},
|
||||||
|
completion = {
|
||||||
|
nvim_cmp = true, -- if using nvim-cmp, otherwise set to false
|
||||||
}
|
}
|
||||||
}
|
})
|
||||||
|
end
|
||||||
|
})
|
||||||
|
|
||||||
-- An asynchronous linter plugin for Neovim complementary to the built-in Language Server Protocol support.
|
-- Creates missing folders on save
|
||||||
-- https://github.com/mfussenegger/nvim-lint
|
-- https://github.com/jghauser/mkdir.nvim
|
||||||
use 'mfussenegger/nvim-lint'
|
use { 'jghauser/mkdir.nvim' }
|
||||||
vim.api.nvim_create_autocmd({ "BufWritePost" }, {
|
|
||||||
callback = function() require("lint").try_lint() end,
|
|
||||||
})
|
|
||||||
|
|
||||||
-- nvim orgmode, to get me use nvim even more.
|
-- Neovim plugin for dimming the highlights of unused
|
||||||
use ({ "nvim-orgmode/orgmode",
|
-- functions, variables, parameters, and more
|
||||||
config = function() require("orgmode").setup({}) end,
|
-- https://github.com/zbirenbaum/neodim
|
||||||
})
|
use {
|
||||||
|
"zbirenbaum/neodim",
|
||||||
|
event = "LspAttach",
|
||||||
|
config = function()
|
||||||
|
require("neodim").setup({
|
||||||
|
alpha = 0.75,
|
||||||
|
blend_color = "#000000",
|
||||||
|
update_in_insert = {
|
||||||
|
enable = true,
|
||||||
|
delay = 100,
|
||||||
|
},
|
||||||
|
hide = {
|
||||||
|
virtual_text = true,
|
||||||
|
signs = true,
|
||||||
|
underline = true,
|
||||||
|
}
|
||||||
|
})
|
||||||
|
end
|
||||||
|
}
|
||||||
|
|
||||||
-- Remaps for the refactoring operations currently offered by the plugin
|
-- EditorConfig plugin for Neovim
|
||||||
local map = vim.api.nvim_set_keymap
|
-- https://github.com/gpanders/editorconfig.nvim
|
||||||
local refactoring_opts = { noremap = true, silent = true, expr = false }
|
use { 'gpanders/editorconfig.nvim' }
|
||||||
map("v", "<leader>re", [[ <Esc><Cmd>lua require('refactoring').refactor('Extract Function')<CR>]], refactoring_opts)
|
|
||||||
map("v", "<leader>rf", [[ <Esc><Cmd>lua require('refactoring').refactor('Extract Function To File')<CR>]], refactoring_opts)
|
|
||||||
map("v", "<leader>rv", [[ <Esc><Cmd>lua require('refactoring').refactor('Extract Variable')<CR>]], refactoring_opts)
|
|
||||||
map("v", "<leader>ri", [[ <Esc><Cmd>lua require('refactoring').refactor('Inline Variable')<CR>]], refactoring_opts)
|
|
||||||
|
|
||||||
-- Extract block doesn't need visual mode
|
-- Use Neovim as a language server to inject LSP diagnostics, code actions, and more via Lua.
|
||||||
map("n", "<leader>rb", [[ <Cmd>lua require('refactoring').refactor('Extract Block')<CR>]], refactoring_opts)
|
-- https://github.com/jose-elias-alvarez/null-ls.nvim
|
||||||
map("n", "<leader>rbf", [[ <Cmd>lua require('refactoring').refactor('Extract Block To File')<CR>]], refactoring_opts)
|
use {
|
||||||
|
"jose-elias-alvarez/null-ls.nvim",
|
||||||
|
config = function()
|
||||||
|
local n = require("null-ls")
|
||||||
|
local b = n.builtins
|
||||||
|
require("null-ls").setup({
|
||||||
|
b.code_actions.eslint,
|
||||||
|
b.code_actions.shellcheck,
|
||||||
|
b.code_actions.xo,
|
||||||
|
b.completion.luasnip,
|
||||||
|
b.completion.spell,
|
||||||
|
b.diagnostics.actionlint,
|
||||||
|
b.diagnostics.alex,
|
||||||
|
b.diagnostics.ansiblelint,
|
||||||
|
b.diagnostics.codespell,
|
||||||
|
b.diagnostics.dotenv_linter,
|
||||||
|
b.diagnostics.editorconfig_checker,
|
||||||
|
b.diagnostics.eslint,
|
||||||
|
b.diagnostics.hadolint,
|
||||||
|
b.diagnostics.jsonlint,
|
||||||
|
b.diagnostics.luacheck,
|
||||||
|
b.diagnostics.markdownlint,
|
||||||
|
b.diagnostics.php,
|
||||||
|
b.diagnostics.phpcs,
|
||||||
|
b.diagnostics.phpstan,
|
||||||
|
b.diagnostics.psalm,
|
||||||
|
b.diagnostics.shellcheck,
|
||||||
|
b.diagnostics.spectral,
|
||||||
|
b.diagnostics.stylelint,
|
||||||
|
b.diagnostics.todo_comments,
|
||||||
|
b.diagnostics.trail_space,
|
||||||
|
b.diagnostics.xo,
|
||||||
|
b.diagnostics.yamllint,
|
||||||
|
b.formatting.blade_formatter,
|
||||||
|
b.formatting.eslint,
|
||||||
|
b.formatting.fixjson,
|
||||||
|
b.formatting.lua_format,
|
||||||
|
b.formatting.markdownlint,
|
||||||
|
b.formatting.prettier,
|
||||||
|
b.formatting.shfmt,
|
||||||
|
b.formatting.stylelint,
|
||||||
|
-- b.formatting.stylua,
|
||||||
|
b.formatting.terraform_fmt,
|
||||||
|
b.formatting.trim_whitespace,
|
||||||
|
b.formatting.yamlfmt,
|
||||||
|
})
|
||||||
|
end,
|
||||||
|
requires = { "nvim-lua/plenary.nvim" }
|
||||||
|
}
|
||||||
|
|
||||||
-- Inline variable can also pick up the identifier currently under the cursor without visual mode
|
-- mason-null-ls bridges mason.nvim with the null-ls plugin
|
||||||
map("n", "<leader>ri", [[ <Cmd>lua require('refactoring').refactor('Inline Variable')<CR>]],refactoring_opts)
|
-- - making it easier to use both plugins together.
|
||||||
|
-- https://github.com/jay-babu/mason-null-ls.nvim
|
||||||
-- prompt for a refactor to apply when the remap is triggered
|
use {
|
||||||
map("v", "<leader>rr", ":lua require('refactoring').select_refactor()<CR>", refactoring_opts)
|
"jayp0521/mason-null-ls.nvim",
|
||||||
|
config = function()
|
||||||
|
require("mason-null-ls").setup({
|
||||||
|
ensure_installed = nil,
|
||||||
|
automatic_installation = true,
|
||||||
|
automatic_setup = false,
|
||||||
|
})
|
||||||
|
end,
|
||||||
|
requires = { "jose-elias-alvarez/null-ls.nvim" }
|
||||||
|
}
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
1
config/nvim/plugin/.gitignore
vendored
Normal file
1
config/nvim/plugin/.gitignore
vendored
Normal file
@@ -0,0 +1 @@
|
|||||||
|
packer_compiled.lua
|
||||||
@@ -1,294 +0,0 @@
|
|||||||
-- Automatically generated packer.nvim plugin loader code
|
|
||||||
|
|
||||||
if vim.api.nvim_call_function('has', {'nvim-0.5'}) ~= 1 then
|
|
||||||
vim.api.nvim_command('echohl WarningMsg | echom "Invalid Neovim version for packer.nvim! | echohl None"')
|
|
||||||
return
|
|
||||||
end
|
|
||||||
|
|
||||||
vim.api.nvim_command('packadd packer.nvim')
|
|
||||||
|
|
||||||
local no_errors, error_msg = pcall(function()
|
|
||||||
|
|
||||||
_G._packer = _G._packer or {}
|
|
||||||
_G._packer.inside_compile = true
|
|
||||||
|
|
||||||
local time
|
|
||||||
local profile_info
|
|
||||||
local should_profile = false
|
|
||||||
if should_profile then
|
|
||||||
local hrtime = vim.loop.hrtime
|
|
||||||
profile_info = {}
|
|
||||||
time = function(chunk, start)
|
|
||||||
if start then
|
|
||||||
profile_info[chunk] = hrtime()
|
|
||||||
else
|
|
||||||
profile_info[chunk] = (hrtime() - profile_info[chunk]) / 1e6
|
|
||||||
end
|
|
||||||
end
|
|
||||||
else
|
|
||||||
time = function(chunk, start) end
|
|
||||||
end
|
|
||||||
|
|
||||||
local function save_profiles(threshold)
|
|
||||||
local sorted_times = {}
|
|
||||||
for chunk_name, time_taken in pairs(profile_info) do
|
|
||||||
sorted_times[#sorted_times + 1] = {chunk_name, time_taken}
|
|
||||||
end
|
|
||||||
table.sort(sorted_times, function(a, b) return a[2] > b[2] end)
|
|
||||||
local results = {}
|
|
||||||
for i, elem in ipairs(sorted_times) do
|
|
||||||
if not threshold or threshold and elem[2] > threshold then
|
|
||||||
results[i] = elem[1] .. ' took ' .. elem[2] .. 'ms'
|
|
||||||
end
|
|
||||||
end
|
|
||||||
if threshold then
|
|
||||||
table.insert(results, '(Only showing plugins that took longer than ' .. threshold .. ' ms ' .. 'to load)')
|
|
||||||
end
|
|
||||||
|
|
||||||
_G._packer.profile_output = results
|
|
||||||
end
|
|
||||||
|
|
||||||
time([[Luarocks path setup]], true)
|
|
||||||
local package_path_str = "/Users/ivuorinen/.cache/nvim/packer_hererocks/2.1.0-beta3/share/lua/5.1/?.lua;/Users/ivuorinen/.cache/nvim/packer_hererocks/2.1.0-beta3/share/lua/5.1/?/init.lua;/Users/ivuorinen/.cache/nvim/packer_hererocks/2.1.0-beta3/lib/luarocks/rocks-5.1/?.lua;/Users/ivuorinen/.cache/nvim/packer_hererocks/2.1.0-beta3/lib/luarocks/rocks-5.1/?/init.lua"
|
|
||||||
local install_cpath_pattern = "/Users/ivuorinen/.cache/nvim/packer_hererocks/2.1.0-beta3/lib/lua/5.1/?.so"
|
|
||||||
if not string.find(package.path, package_path_str, 1, true) then
|
|
||||||
package.path = package.path .. ';' .. package_path_str
|
|
||||||
end
|
|
||||||
|
|
||||||
if not string.find(package.cpath, install_cpath_pattern, 1, true) then
|
|
||||||
package.cpath = package.cpath .. ';' .. install_cpath_pattern
|
|
||||||
end
|
|
||||||
|
|
||||||
time([[Luarocks path setup]], false)
|
|
||||||
time([[try_loadstring definition]], true)
|
|
||||||
local function try_loadstring(s, component, name)
|
|
||||||
local success, result = pcall(loadstring(s), name, _G.packer_plugins[name])
|
|
||||||
if not success then
|
|
||||||
vim.schedule(function()
|
|
||||||
vim.api.nvim_notify('packer.nvim: Error running ' .. component .. ' for ' .. name .. ': ' .. result, vim.log.levels.ERROR, {})
|
|
||||||
end)
|
|
||||||
end
|
|
||||||
return result
|
|
||||||
end
|
|
||||||
|
|
||||||
time([[try_loadstring definition]], false)
|
|
||||||
time([[Defining packer_plugins]], true)
|
|
||||||
_G.packer_plugins = {
|
|
||||||
["Comment.nvim"] = {
|
|
||||||
loaded = true,
|
|
||||||
path = "/Users/ivuorinen/.local/share/nvim/site/pack/packer/start/Comment.nvim",
|
|
||||||
url = "https://github.com/numToStr/Comment.nvim"
|
|
||||||
},
|
|
||||||
LuaSnip = {
|
|
||||||
loaded = true,
|
|
||||||
path = "/Users/ivuorinen/.local/share/nvim/site/pack/packer/start/LuaSnip",
|
|
||||||
url = "https://github.com/L3MON4D3/LuaSnip"
|
|
||||||
},
|
|
||||||
["barbar.nvim"] = {
|
|
||||||
loaded = true,
|
|
||||||
path = "/Users/ivuorinen/.local/share/nvim/site/pack/packer/start/barbar.nvim",
|
|
||||||
url = "https://github.com/romgrk/barbar.nvim",
|
|
||||||
wants = { "nvim-web-devicons" }
|
|
||||||
},
|
|
||||||
catppuccin = {
|
|
||||||
loaded = true,
|
|
||||||
path = "/Users/ivuorinen/.local/share/nvim/site/pack/packer/start/catppuccin",
|
|
||||||
url = "https://github.com/catppuccin/nvim"
|
|
||||||
},
|
|
||||||
["cmp-nvim-lsp"] = {
|
|
||||||
loaded = true,
|
|
||||||
path = "/Users/ivuorinen/.local/share/nvim/site/pack/packer/start/cmp-nvim-lsp",
|
|
||||||
url = "https://github.com/hrsh7th/cmp-nvim-lsp"
|
|
||||||
},
|
|
||||||
cmp_luasnip = {
|
|
||||||
loaded = true,
|
|
||||||
path = "/Users/ivuorinen/.local/share/nvim/site/pack/packer/start/cmp_luasnip",
|
|
||||||
url = "https://github.com/saadparwaiz1/cmp_luasnip"
|
|
||||||
},
|
|
||||||
["dressing.nvim"] = {
|
|
||||||
loaded = true,
|
|
||||||
path = "/Users/ivuorinen/.local/share/nvim/site/pack/packer/start/dressing.nvim",
|
|
||||||
url = "https://github.com/stevearc/dressing.nvim"
|
|
||||||
},
|
|
||||||
["fidget.nvim"] = {
|
|
||||||
loaded = true,
|
|
||||||
path = "/Users/ivuorinen/.local/share/nvim/site/pack/packer/start/fidget.nvim",
|
|
||||||
url = "https://github.com/j-hui/fidget.nvim"
|
|
||||||
},
|
|
||||||
["gitsigns.nvim"] = {
|
|
||||||
loaded = true,
|
|
||||||
path = "/Users/ivuorinen/.local/share/nvim/site/pack/packer/start/gitsigns.nvim",
|
|
||||||
url = "https://github.com/lewis6991/gitsigns.nvim"
|
|
||||||
},
|
|
||||||
["indent-blankline.nvim"] = {
|
|
||||||
loaded = true,
|
|
||||||
path = "/Users/ivuorinen/.local/share/nvim/site/pack/packer/start/indent-blankline.nvim",
|
|
||||||
url = "https://github.com/lukas-reineke/indent-blankline.nvim"
|
|
||||||
},
|
|
||||||
["lualine.nvim"] = {
|
|
||||||
loaded = true,
|
|
||||||
path = "/Users/ivuorinen/.local/share/nvim/site/pack/packer/start/lualine.nvim",
|
|
||||||
url = "https://github.com/nvim-lualine/lualine.nvim"
|
|
||||||
},
|
|
||||||
["markdown-preview.nvim"] = {
|
|
||||||
loaded = true,
|
|
||||||
path = "/Users/ivuorinen/.local/share/nvim/site/pack/packer/start/markdown-preview.nvim",
|
|
||||||
url = "https://github.com/iamcco/markdown-preview.nvim"
|
|
||||||
},
|
|
||||||
["mason-lspconfig.nvim"] = {
|
|
||||||
loaded = true,
|
|
||||||
path = "/Users/ivuorinen/.local/share/nvim/site/pack/packer/start/mason-lspconfig.nvim",
|
|
||||||
url = "https://github.com/williamboman/mason-lspconfig.nvim"
|
|
||||||
},
|
|
||||||
["mason.nvim"] = {
|
|
||||||
loaded = true,
|
|
||||||
path = "/Users/ivuorinen/.local/share/nvim/site/pack/packer/start/mason.nvim",
|
|
||||||
url = "https://github.com/williamboman/mason.nvim"
|
|
||||||
},
|
|
||||||
["notifier.nvim"] = {
|
|
||||||
loaded = true,
|
|
||||||
path = "/Users/ivuorinen/.local/share/nvim/site/pack/packer/start/notifier.nvim",
|
|
||||||
url = "https://github.com/vigoux/notifier.nvim"
|
|
||||||
},
|
|
||||||
["nvim-cmp"] = {
|
|
||||||
loaded = true,
|
|
||||||
path = "/Users/ivuorinen/.local/share/nvim/site/pack/packer/start/nvim-cmp",
|
|
||||||
url = "https://github.com/hrsh7th/nvim-cmp"
|
|
||||||
},
|
|
||||||
["nvim-lint"] = {
|
|
||||||
loaded = true,
|
|
||||||
path = "/Users/ivuorinen/.local/share/nvim/site/pack/packer/start/nvim-lint",
|
|
||||||
url = "https://github.com/mfussenegger/nvim-lint"
|
|
||||||
},
|
|
||||||
["nvim-lspconfig"] = {
|
|
||||||
loaded = true,
|
|
||||||
path = "/Users/ivuorinen/.local/share/nvim/site/pack/packer/start/nvim-lspconfig",
|
|
||||||
url = "https://github.com/neovim/nvim-lspconfig"
|
|
||||||
},
|
|
||||||
["nvim-notify"] = {
|
|
||||||
loaded = true,
|
|
||||||
path = "/Users/ivuorinen/.local/share/nvim/site/pack/packer/start/nvim-notify",
|
|
||||||
url = "https://github.com/rcarriga/nvim-notify"
|
|
||||||
},
|
|
||||||
["nvim-treesitter"] = {
|
|
||||||
loaded = true,
|
|
||||||
path = "/Users/ivuorinen/.local/share/nvim/site/pack/packer/start/nvim-treesitter",
|
|
||||||
url = "https://github.com/nvim-treesitter/nvim-treesitter"
|
|
||||||
},
|
|
||||||
["nvim-treesitter-textobjects"] = {
|
|
||||||
load_after = {},
|
|
||||||
loaded = true,
|
|
||||||
needs_bufread = false,
|
|
||||||
path = "/Users/ivuorinen/.local/share/nvim/site/pack/packer/opt/nvim-treesitter-textobjects",
|
|
||||||
url = "https://github.com/nvim-treesitter/nvim-treesitter-textobjects"
|
|
||||||
},
|
|
||||||
["nvim-web-devicons"] = {
|
|
||||||
loaded = true,
|
|
||||||
path = "/Users/ivuorinen/.local/share/nvim/site/pack/packer/start/nvim-web-devicons",
|
|
||||||
url = "https://github.com/nvim-tree/nvim-web-devicons"
|
|
||||||
},
|
|
||||||
orgmode = {
|
|
||||||
config = { "\27LJ\2\n9\0\0\3\0\3\0\a6\0\0\0'\2\1\0B\0\2\0029\0\2\0004\2\0\0B\0\2\1K\0\1\0\nsetup\forgmode\frequire\0" },
|
|
||||||
loaded = true,
|
|
||||||
path = "/Users/ivuorinen/.local/share/nvim/site/pack/packer/start/orgmode",
|
|
||||||
url = "https://github.com/nvim-orgmode/orgmode"
|
|
||||||
},
|
|
||||||
["packer.nvim"] = {
|
|
||||||
loaded = true,
|
|
||||||
path = "/Users/ivuorinen/.local/share/nvim/site/pack/packer/start/packer.nvim",
|
|
||||||
url = "https://github.com/wbthomason/packer.nvim"
|
|
||||||
},
|
|
||||||
["palenight.vim"] = {
|
|
||||||
loaded = true,
|
|
||||||
path = "/Users/ivuorinen/.local/share/nvim/site/pack/packer/start/palenight.vim",
|
|
||||||
url = "https://github.com/drewtempelmeyer/palenight.vim"
|
|
||||||
},
|
|
||||||
["plenary.nvim"] = {
|
|
||||||
loaded = true,
|
|
||||||
path = "/Users/ivuorinen/.local/share/nvim/site/pack/packer/start/plenary.nvim",
|
|
||||||
url = "https://github.com/nvim-lua/plenary.nvim"
|
|
||||||
},
|
|
||||||
["refactoring.nvim"] = {
|
|
||||||
loaded = true,
|
|
||||||
path = "/Users/ivuorinen/.local/share/nvim/site/pack/packer/start/refactoring.nvim",
|
|
||||||
url = "https://github.com/ThePrimeagen/refactoring.nvim"
|
|
||||||
},
|
|
||||||
["telescope-fzf-native.nvim"] = {
|
|
||||||
cond = { true },
|
|
||||||
loaded = false,
|
|
||||||
needs_bufread = false,
|
|
||||||
only_cond = true,
|
|
||||||
path = "/Users/ivuorinen/.local/share/nvim/site/pack/packer/opt/telescope-fzf-native.nvim",
|
|
||||||
url = "https://github.com/nvim-telescope/telescope-fzf-native.nvim"
|
|
||||||
},
|
|
||||||
["telescope.nvim"] = {
|
|
||||||
loaded = true,
|
|
||||||
path = "/Users/ivuorinen/.local/share/nvim/site/pack/packer/start/telescope.nvim",
|
|
||||||
url = "https://github.com/nvim-telescope/telescope.nvim"
|
|
||||||
},
|
|
||||||
["todo-comments.nvim"] = {
|
|
||||||
config = { "\27LJ\2\n?\0\0\3\0\3\0\a6\0\0\0'\2\1\0B\0\2\0029\0\2\0004\2\0\0B\0\2\1K\0\1\0\nsetup\18todo-comments\frequire\0" },
|
|
||||||
loaded = true,
|
|
||||||
path = "/Users/ivuorinen/.local/share/nvim/site/pack/packer/start/todo-comments.nvim",
|
|
||||||
url = "https://github.com/folke/todo-comments.nvim"
|
|
||||||
},
|
|
||||||
["vim-fugitive"] = {
|
|
||||||
loaded = true,
|
|
||||||
path = "/Users/ivuorinen/.local/share/nvim/site/pack/packer/start/vim-fugitive",
|
|
||||||
url = "https://github.com/tpope/vim-fugitive"
|
|
||||||
},
|
|
||||||
["vim-rhubarb"] = {
|
|
||||||
loaded = true,
|
|
||||||
path = "/Users/ivuorinen/.local/share/nvim/site/pack/packer/start/vim-rhubarb",
|
|
||||||
url = "https://github.com/tpope/vim-rhubarb"
|
|
||||||
},
|
|
||||||
["vim-sleuth"] = {
|
|
||||||
loaded = true,
|
|
||||||
path = "/Users/ivuorinen/.local/share/nvim/site/pack/packer/start/vim-sleuth",
|
|
||||||
url = "https://github.com/tpope/vim-sleuth"
|
|
||||||
},
|
|
||||||
["which-key.nvim"] = {
|
|
||||||
config = { "\27LJ\2\n;\0\0\3\0\3\0\a6\0\0\0'\2\1\0B\0\2\0029\0\2\0004\2\0\0B\0\2\1K\0\1\0\nsetup\14which-key\frequire\0" },
|
|
||||||
loaded = true,
|
|
||||||
path = "/Users/ivuorinen/.local/share/nvim/site/pack/packer/start/which-key.nvim",
|
|
||||||
url = "https://github.com/folke/which-key.nvim"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
time([[Defining packer_plugins]], false)
|
|
||||||
-- Config for: orgmode
|
|
||||||
time([[Config for orgmode]], true)
|
|
||||||
try_loadstring("\27LJ\2\n9\0\0\3\0\3\0\a6\0\0\0'\2\1\0B\0\2\0029\0\2\0004\2\0\0B\0\2\1K\0\1\0\nsetup\forgmode\frequire\0", "config", "orgmode")
|
|
||||||
time([[Config for orgmode]], false)
|
|
||||||
-- Config for: todo-comments.nvim
|
|
||||||
time([[Config for todo-comments.nvim]], true)
|
|
||||||
try_loadstring("\27LJ\2\n?\0\0\3\0\3\0\a6\0\0\0'\2\1\0B\0\2\0029\0\2\0004\2\0\0B\0\2\1K\0\1\0\nsetup\18todo-comments\frequire\0", "config", "todo-comments.nvim")
|
|
||||||
time([[Config for todo-comments.nvim]], false)
|
|
||||||
-- Config for: which-key.nvim
|
|
||||||
time([[Config for which-key.nvim]], true)
|
|
||||||
try_loadstring("\27LJ\2\n;\0\0\3\0\3\0\a6\0\0\0'\2\1\0B\0\2\0029\0\2\0004\2\0\0B\0\2\1K\0\1\0\nsetup\14which-key\frequire\0", "config", "which-key.nvim")
|
|
||||||
time([[Config for which-key.nvim]], false)
|
|
||||||
-- Conditional loads
|
|
||||||
time([[Conditional loading of telescope-fzf-native.nvim]], true)
|
|
||||||
require("packer.load")({"telescope-fzf-native.nvim"}, {}, _G.packer_plugins)
|
|
||||||
time([[Conditional loading of telescope-fzf-native.nvim]], false)
|
|
||||||
-- Load plugins in order defined by `after`
|
|
||||||
time([[Sequenced loading]], true)
|
|
||||||
vim.cmd [[ packadd nvim-treesitter ]]
|
|
||||||
vim.cmd [[ packadd nvim-treesitter-textobjects ]]
|
|
||||||
time([[Sequenced loading]], false)
|
|
||||||
|
|
||||||
_G._packer.inside_compile = false
|
|
||||||
if _G._packer.needs_bufread == true then
|
|
||||||
vim.cmd("doautocmd BufRead")
|
|
||||||
end
|
|
||||||
_G._packer.needs_bufread = false
|
|
||||||
|
|
||||||
if should_profile then save_profiles() end
|
|
||||||
|
|
||||||
end)
|
|
||||||
|
|
||||||
if not no_errors then
|
|
||||||
error_msg = error_msg:gsub('"', '\\"')
|
|
||||||
vim.api.nvim_command('echohl ErrorMsg | echom "Error in packer_compiled: '..error_msg..'" | echom "Please check your config for correctness" | echohl None')
|
|
||||||
end
|
|
||||||
@@ -109,7 +109,7 @@ function section_dotfiles
|
|||||||
rcup -B 0 -g \
|
rcup -B 0 -g \
|
||||||
| tee "$INSTALL_SCRIPT" 1> /dev/null \
|
| tee "$INSTALL_SCRIPT" 1> /dev/null \
|
||||||
&& sed -i '' "s|$HOME|\$HOME|g" "$INSTALL_SCRIPT" \
|
&& sed -i '' "s|$HOME|\$HOME|g" "$INSTALL_SCRIPT" \
|
||||||
&& sed -i '' "s|install.sh|$(basename $INSTALL_SCRIPT)|g" "$INSTALL_SCRIPT"
|
&& sed -i '' "s|install.sh|$(basename "$INSTALL_SCRIPT")|g" "$INSTALL_SCRIPT"
|
||||||
$0 dotfiles shfmt
|
$0 dotfiles shfmt
|
||||||
msg_done "🎉 Done!"
|
msg_done "🎉 Done!"
|
||||||
;;
|
;;
|
||||||
|
|||||||
Reference in New Issue
Block a user