MOOOOOREEE LAZZZYYYYYYYY

This commit is contained in:
fiplox 2023-01-01 19:36:00 +01:00
parent 1c85ed72c9
commit f06cd03050
11 changed files with 75 additions and 84 deletions

View File

@ -1,4 +1,4 @@
local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim" local lazypath = vim.fn.stdpath 'data' .. '/lazy/lazy.nvim'
if not vim.loop.fs_stat(lazypath) then if not vim.loop.fs_stat(lazypath) then
vim.fn.system({ vim.fn.system({
"git", "git",
@ -13,7 +13,13 @@ vim.opt.runtimepath:prepend(lazypath)
require 'config.settings' require 'config.settings'
require 'config.lazy' require 'config.lazy'
require 'config.mappings'
vim.api.nvim_create_autocmd('User', {
pattern = 'VeryLazy',
callback = function()
require 'config.autocmd' require 'config.autocmd'
require 'config.mappings'
end,
})
vim.cmd 'colorscheme tokyonight' vim.cmd 'colorscheme tokyonight'

View File

@ -9,7 +9,7 @@
"feline.nvim": { "branch": "master", "commit": "d48b6f92c6ccdd6654c956f437be49ea160b5b0c" }, "feline.nvim": { "branch": "master", "commit": "d48b6f92c6ccdd6654c956f437be49ea160b5b0c" },
"fm-nvim": { "branch": "master", "commit": "8e6a77049330e7c797eb9e63affd75eb796fe75e" }, "fm-nvim": { "branch": "master", "commit": "8e6a77049330e7c797eb9e63affd75eb796fe75e" },
"hop.nvim": { "branch": "master", "commit": "90db1b2c61b820e230599a04fedcd2679e64bd07" }, "hop.nvim": { "branch": "master", "commit": "90db1b2c61b820e230599a04fedcd2679e64bd07" },
"lazy.nvim": { "branch": "main", "commit": "1edd1b8945ee91cdfd61654af96c427dce285a9d" }, "lazy.nvim": { "branch": "main", "commit": "11eee43c7ee63a71b08009769437e8a10814a48c" },
"lsp": { "branch": "master", "commit": "6b43ce561d97412cc512b569db6938e44529293e" }, "lsp": { "branch": "master", "commit": "6b43ce561d97412cc512b569db6938e44529293e" },
"mason-lspconfig.nvim": { "branch": "main", "commit": "aa25b4153d2f2636c3b3a8c8360349d2b29e7ae3" }, "mason-lspconfig.nvim": { "branch": "main", "commit": "aa25b4153d2f2636c3b3a8c8360349d2b29e7ae3" },
"mason.nvim": { "branch": "main", "commit": "8fd6559eecbabb39c68d147f1b2cccb8d2d2d2a1" }, "mason.nvim": { "branch": "main", "commit": "8fd6559eecbabb39c68d147f1b2cccb8d2d2d2a1" },
@ -18,8 +18,7 @@
"nvim-cmp": { "branch": "main", "commit": "c49ad26e894e137e401b1d294948c46327877eaf" }, "nvim-cmp": { "branch": "main", "commit": "c49ad26e894e137e401b1d294948c46327877eaf" },
"nvim-colorizer.lua": { "branch": "master", "commit": "760e27df4dd966607e8fb7fd8b6b93e3c7d2e193" }, "nvim-colorizer.lua": { "branch": "master", "commit": "760e27df4dd966607e8fb7fd8b6b93e3c7d2e193" },
"nvim-snippy": { "branch": "master", "commit": "834820d5441e9c26de4bea4de95de5e117c058a5" }, "nvim-snippy": { "branch": "master", "commit": "834820d5441e9c26de4bea4de95de5e117c058a5" },
"nvim-treesitter": { "branch": "master", "commit": "b019eb30323635d680aa2f32e498a1831676ebb1" }, "nvim-treesitter": { "branch": "master", "commit": "3a621b9a8362fac358d828254485024986d6d81b" },
"nvim-web-devicons": { "branch": "master", "commit": "05e1072f63f6c194ac6e867b567e6b437d3d4622" },
"plenary.nvim": { "branch": "master", "commit": "4b7e52044bbb84242158d977a50c4cbcd85070c7" }, "plenary.nvim": { "branch": "master", "commit": "4b7e52044bbb84242158d977a50c4cbcd85070c7" },
"telescope-file-browser.nvim": { "branch": "master", "commit": "304508fb7bea78e3c0eeddd88c4837501e403ae8" }, "telescope-file-browser.nvim": { "branch": "master", "commit": "304508fb7bea78e3c0eeddd88c4837501e403ae8" },
"telescope.nvim": { "branch": "master", "commit": "a606bd10c79ec5989c76c49cc6f736e88b63f0da" }, "telescope.nvim": { "branch": "master", "commit": "a606bd10c79ec5989c76c49cc6f736e88b63f0da" },

View File

@ -1,6 +1,7 @@
local M = { local M = {
'numToStr/Comment.nvim', 'numToStr/Comment.nvim',
event = 'VeryLazy', -- event = 'VeryLazy',
keys = { 'gcc', { 'gc', mode = 'v' }, {'gb', mode = 'v'} },
} }
function M.config() function M.config()

View File

@ -1,7 +1,10 @@
local M = { local M = {
'hrsh7th/nvim-cmp', 'hrsh7th/nvim-cmp',
lazy = false, -- lazy = false,
dependencies = { dependencies = {
{ 'honza/vim-snippets' },
{ 'dcampos/nvim-snippy' },
{ 'dcampos/cmp-snippy' },
'hrsh7th/cmp-nvim-lsp', 'hrsh7th/cmp-nvim-lsp',
'hrsh7th/cmp-buffer', 'hrsh7th/cmp-buffer',
'hrsh7th/cmp-cmdline', 'hrsh7th/cmp-cmdline',
@ -12,7 +15,6 @@ local M = {
function M.config() function M.config()
local cmp = require 'cmp' local cmp = require 'cmp'
local snippy = require 'snippy'
local ELLIPSIS_CHAR = '' local ELLIPSIS_CHAR = ''
local MAX_LABEL_WIDTH = 20 local MAX_LABEL_WIDTH = 20
@ -87,8 +89,8 @@ function M.config()
['<Tab>'] = cmp.mapping(function(fallback) ['<Tab>'] = cmp.mapping(function(fallback)
if cmp.visible() then if cmp.visible() then
cmp.select_next_item { behavior = cmp.SelectBehavior.Insert } cmp.select_next_item { behavior = cmp.SelectBehavior.Insert }
elseif snippy.can_expand_or_advance() then elseif require('snippy').can_expand_or_advance() then
snippy.expand_or_advance() require('snippy').expand_or_advance()
elseif has_words_before() then elseif has_words_before() then
cmp.complete() cmp.complete()
else else
@ -99,8 +101,8 @@ function M.config()
['<S-Tab>'] = cmp.mapping(function(fallback) ['<S-Tab>'] = cmp.mapping(function(fallback)
if cmp.visible() then if cmp.visible() then
cmp.select_prev_item { behavior = cmp.SelectBehavior.Insert } cmp.select_prev_item { behavior = cmp.SelectBehavior.Insert }
elseif snippy.can_jump(-1) then elseif require('snippy').can_jump(-1) then
snippy.previous() require('snippy').previous()
else else
fallback() fallback()
end end
@ -115,7 +117,6 @@ function M.config()
}, },
} }
cmp.setup.cmdline(':', { cmp.setup.cmdline(':', {
completion = { autocomplete = true },
mapping = { mapping = {
['<TAB>'] = cmp.mapping(function(fallback) ['<TAB>'] = cmp.mapping(function(fallback)
if cmp.visible() then if cmp.visible() then
@ -153,7 +154,6 @@ function M.config()
entries = { name = 'wildmenu', separator = ' · ' }, entries = { name = 'wildmenu', separator = ' · ' },
}, },
}) })
end end
return M return M

View File

@ -1,6 +1,7 @@
return { return {
'NvChad/nvim-colorizer.lua', 'NvChad/nvim-colorizer.lua',
event = 'BufReadPre', -- event = 'BufReadPre',
cmd = 'ColorizerToggle',
config = { config = {
filetypes = { '*', '!lazy' }, filetypes = { '*', '!lazy' },
buftype = { '*', '!prompt', '!nofile' }, buftype = { '*', '!prompt', '!nofile' },

View File

@ -2,9 +2,9 @@ local M = {
'feline-nvim/feline.nvim', 'feline-nvim/feline.nvim',
-- lazy = false -- lazy = false
event = 'UIEnter', event = 'UIEnter',
dependencies = { -- dependencies = {
'nvim-tree/nvim-web-devicons', -- 'nvim-tree/nvim-web-devicons',
}, -- },
} }
function M.config() function M.config()
@ -95,11 +95,14 @@ function M.config()
separator = { separator = {
provider = '', provider = '',
}, },
fileinfo = { file_info = {
provider = { provider = {
name = 'file_info', name = 'file_info',
opts = { opts = {
colored_icon = false,
type = 'relative-short', type = 'relative-short',
file_readonly_icon = '',
file_modified_icon = '',
}, },
}, },
hl = { hl = {
@ -143,7 +146,8 @@ function M.config()
provider = { provider = {
name = 'file_type', name = 'file_type',
opts = { opts = {
filetype_icon = true, -- filetype_icon = true,
colored_icon = false,
case = 'titlecase', case = 'titlecase',
}, },
}, },
@ -196,7 +200,7 @@ function M.config()
local left = { local left = {
c.vim_mode, c.vim_mode,
c.fileinfo, c.file_info,
-- c.gitBranch, -- c.gitBranch,
-- c.gitDiffAdded, -- c.gitDiffAdded,
-- c.gitDiffRemoved, -- c.gitDiffRemoved,

View File

@ -1,22 +1,23 @@
return { return {
'nvim-lua/plenary.nvim', 'nvim-lua/plenary.nvim',
{ 'honza/vim-snippets', lazy = false }, 'folke/which-key.nvim',
{ 'dcampos/nvim-snippy', lazy = false },
{ 'dcampos/cmp-snippy', lazy = false },
-- { 'kdheepak/lazygit.nvim', cmd = 'LazyGit' }, -- { 'kdheepak/lazygit.nvim', cmd = 'LazyGit' },
{ 'is0n/fm-nvim', cmd = { {
'is0n/fm-nvim',
cmd = {
'Neomutt', 'Neomutt',
'Lazygit', 'Lazygit',
'Lf', 'Lf',
} }, },
},
'williamboman/mason-lspconfig.nvim', 'williamboman/mason-lspconfig.nvim',
{ {
'phaazon/hop.nvim', 'phaazon/hop.nvim',
event = 'BufRead', -- event = 'BufRead',
keys = { { 's', ':HopChar2<cr>' }, { 'S', ':HopWord<cr>' } },
config = function() config = function()
require('hop').setup() require('hop').setup()
vim.api.nvim_set_keymap('n', 's', ':HopChar2<cr>', { silent = true })
vim.api.nvim_set_keymap('n', 'S', ':HopWord<cr>', { silent = true })
end, end,
}, },
-- { 'dstein64/vim-startuptime', lazy = false },
} }

View File

@ -1,7 +1,7 @@
local M = { local M = {
'neovim/nvim-lspconfig', 'neovim/nvim-lspconfig',
name = 'lsp', name = 'lsp',
event = 'BufReadPre', event = 'BufRead',
dependencies = { 'hrsh7th/cmp-nvim-lsp' }, dependencies = { 'hrsh7th/cmp-nvim-lsp' },
} }
@ -142,11 +142,11 @@ function M.config()
border = 'rounded', border = 'rounded',
}) })
--[[ local on_references = vim.lsp.handlers['textDocument/references'] ]] local on_references = vim.lsp.handlers['textDocument/references']
--[[ vim.lsp.handlers['textDocument/references'] = vim.lsp.with(on_references, { ]] vim.lsp.handlers['textDocument/references'] = vim.lsp.with(on_references, {
--[[ -- Use location list instead of quickfix list ]] -- Use location list instead of quickfix list
--[[ loclist = true, ]] loclist = true,
--[[ }) ]] })
end end
return M return M

View File

@ -8,20 +8,13 @@ local function project_files()
if client then if client then
opts.cwd = client.config.root_dir opts.cwd = client.config.root_dir
end end
-- require('telescope.builtin').find_files(opts) require('telescope.builtin').find_files(opts)
require('telescope').extensions.file_browser.file_browser()
end end
end end
local M = { local M = {
'nvim-telescope/telescope.nvim', 'nvim-telescope/telescope.nvim',
cmd = { 'Telescope' }, cmd = { 'Telescope' },
keys = {
{ '<leader><space>', project_files, desc = 'Find File' },
},
dependencies = {
'nvim-telescope/telescope-file-browser.nvim',
},
} }
function M.config() function M.config()
@ -50,20 +43,6 @@ function M.config()
-- local fb_actions = require "telescope".extensions.file_browser.actions -- local fb_actions = require "telescope".extensions.file_browser.actions
telescope.setup { telescope.setup {
extensions = {
file_browser = {
theme = 'ivy',
-- disables netrw and use telescope-file-browser in its place
hijack_netrw = true,
mappings = {
['i'] = {
},
['n'] = {
-- your custom normal mode mappings
},
},
},
},
pickers = { pickers = {
find_files = { find_files = {
theme = 'dropdown', theme = 'dropdown',

View File

@ -8,25 +8,25 @@ function M.config()
local configs = require 'nvim-treesitter.configs' local configs = require 'nvim-treesitter.configs'
configs.setup { configs.setup {
ensure_installed = { -- ensure_installed = {
'bash', -- 'bash',
'c', -- 'c',
'cpp', -- 'cpp',
'go', -- 'go',
'javascript', -- 'javascript',
'typescript', -- 'typescript',
'json', -- 'json',
'lua', -- 'lua',
'python', -- 'python',
'rust', -- 'rust',
'html', -- 'html',
'css', -- 'css',
'toml', -- 'toml',
'latex', -- 'latex',
'markdown', -- 'markdown',
'vim', -- 'vim',
'dot', -- 'dot',
}, -- },
ignore_install = { 'haskell' }, ignore_install = { 'haskell' },
-- matchup = { -- matchup = {
-- enable = true -- mandatory, false will disable the whole extension -- enable = true -- mandatory, false will disable the whole extension

View File

@ -1,8 +1,8 @@
local M = { local M = {
'folke/trouble.nvim', 'folke/trouble.nvim',
dependencies = { -- dependencies = {
'nvim-tree/nvim-web-devicons', -- 'nvim-tree/nvim-web-devicons',
}, -- },
cmd = { 'TroubleToggle', 'Trouble' }, cmd = { 'TroubleToggle', 'Trouble' },
} }
@ -13,7 +13,7 @@ function M.config()
position = 'bottom', -- position of the list can be: bottom, top, left, right position = 'bottom', -- position of the list can be: bottom, top, left, right
height = 10, -- height of the trouble list when position is top or bottom height = 10, -- height of the trouble list when position is top or bottom
width = 50, -- width of the list when position is left or right width = 50, -- width of the list when position is left or right
icons = true, -- use devicons for filenames icons = false, -- use devicons for filenames
mode = 'document_diagnostics', -- "workspace_diagnostics", "document_diagnostics", "quickfix", "lsp_references", "loclist" mode = 'document_diagnostics', -- "workspace_diagnostics", "document_diagnostics", "quickfix", "lsp_references", "loclist"
fold_open = '', -- icon used for open folds fold_open = '', -- icon used for open folds
fold_closed = '', -- icon used for closed folds fold_closed = '', -- icon used for closed folds