start restructering of lazy

This commit is contained in:
2022-12-28 13:52:17 +01:00
parent 5dd99d7085
commit fd16ef223a
11 changed files with 352 additions and 631 deletions

211
lua/plugins/init.lua Normal file
View File

@ -0,0 +1,211 @@
return {
{
'mrjones2014/legendary.nvim',
config = function()
require('setup/my_legendary')
require('legendary').keymaps(
{
{
'<leader>i',
function()
require("lazy").home()
end,
description = 'Start lazy home'
}
}
)
end,
dependencies = {
'stevearc/dressing.nvim',
'nvim-telescope/telescope.nvim',
},
keys = { '<leader>p', '<leader>i' }
},
{
'p00f/nvim-ts-rainbow',
dependencies = 'nvim-treesitter/nvim-treesitter',
event = 'VeryLazy'
},
{
'ahmedkhalf/project.nvim',
config = function()
require('setup/project')
end,
event = 'VeryLazy'
},
{
'eddyekofo94/gruvbox-flat.nvim',
disable = false,
config = function()
require('setup/my_gruvbox_flat')
end
},
{
'lukas-reineke/indent-blankline.nvim',
dependencies = {
'nvim-treesitter/nvim-treesitter',
},
config = function()
require('setup/indent_blankline')
end,
},
{
'lewis6991/gitsigns.nvim',
config = function()
require('setup/gitsigns')
end,
},
{
'numToStr/Comment.nvim',
config = function()
require('setup/comment')
end,
keys = '<c-c>'
},
{
'hoob3rt/lualine.nvim',
dependencies = { 'kyazdani42/nvim-web-devicons' },
config = function()
require('setup/lualine')
end,
},
{
'hrsh7th/nvim-cmp',
dependencies = {
{ 'onsails/lspkind-nvim' },
{ 'hrsh7th/cmp-buffer' },
{ 'hrsh7th/cmp-nvim-lsp' },
{
'L3MON4D3/LuaSnip',
config = function()
require('setup/luasnip')
end,
dependencies =
{
'rafamadriz/friendly-snippets'
}
},
{ 'saadparwaiz1/cmp_luasnip' },
{ 'hrsh7th/cmp-nvim-lua' },
{ 'octaltree/cmp-look' },
{ 'hrsh7th/cmp-path' },
{ 'hrsh7th/cmp-calc' },
{ 'f3fora/cmp-spell' },
{ 'hrsh7th/cmp-emoji' },
{ 'hrsh7th/cmp-cmdline' },
{ 'dmitmel/cmp-cmdline-history' },
{ 'ray-x/cmp-treesitter' },
{ 'hrsh7th/cmp-nvim-lsp-signature-help' },
{ 'p00f/clangd_extensions.nvim' },
{
'windwp/nvim-autopairs',
config = function()
require('setup/nvim-autopairs')
end
},
},
config = function()
require('setup/my_cmp')
end,
event = { 'InsertEnter', 'CmdLineEnter' },
},
{
'neovim/nvim-lspconfig',
dependencies = {
'williamboman/mason.nvim',
'williamboman/mason-lspconfig.nvim',
'p00f/clangd_extensions.nvim',
'jose-elias-alvarez/null-ls.nvim',
'ray-x/lsp_signature.nvim',
},
config = function()
require('setup/my_lspconfig')
end,
event = 'VeryLazy'
},
{
'akinsho/toggleterm.nvim',
config = function()
require('setup/toggleterm')
end,
cmd = 'ToggleTerm',
keys = '<space>g'
},
{
'gbprod/yanky.nvim',
config = function()
require('setup/yanky')
end,
keys = {
{ '<c-n>' },
{ '<c-o>' }
},
dependencies = {
'nvim-telescope/telescope.nvim'
}
},
{
'stevearc/aerial.nvim',
dependencies = {
'nvim-telescope/telescope.nvim'
},
config = function()
require('setup/aerial')
end,
cmd = 'AerialToggle',
keys = {
{ '<leader>s' }
}
},
{
'ggandor/leap.nvim',
dependencies = { 'tpope/vim-repeat' },
config = function()
require('setup/my_leap')
end,
event = 'VeryLazy'
},
{
'mfussenegger/nvim-dap',
dependencies = {
'mfussenegger/nvim-dap-python',
'theHamsta/nvim-dap-virtual-text',
{
'nvim-telescope/telescope-dap.nvim',
dependencies = 'telescope.nvim',
},
'rcarriga/nvim-dap-ui',
'rcarriga/cmp-dap',
},
keys = {
{ '<F5>' },
{ '<F6>' },
{ '<F7>' },
{ '<F8>' },
{ '<F9>' },
{ '<F10>' },
{ '<F11>' },
{ '<S-F11>' }
},
config = function()
require('setup/my_dap')
end,
},
{
'sindrets/diffview.nvim',
dependencies = 'nvim-lua/plenary.nvim',
config = function()
require('setup/my_diffview')
end,
cmd = 'DiffviewOpen',
},
{
'stevearc/overseer.nvim',
config = function()
require('setup/my_overseer')
end,
keys = {
{ '<F4>' }
},
}
}

62
lua/plugins/neotree.lua Normal file
View File

@ -0,0 +1,62 @@
return {
'nvim-neo-tree/neo-tree.nvim',
cmd = 'Neotree',
keys = {
{ '\\', '<cmd>Neotree reveal<cr>', desc = 'NeoTree' },
},
dependencies = {
'nvim-lua/plenary.nvim',
-- 'nvim-tree/nvim-web-devicons', -- not strictly required, but recommended
'kyazdani42/nvim-web-devicons',
'MunifTanjim/nui.nvim',
},
config = {
window = { -- see https://github.com/MunifTanjim/nui.nvim/tree/main/lua/nui/popup for
-- possible options. These can also be functions that return these options.
position = 'float', -- left, right, float, current
width = 40, -- applies to left and right positions
popup = { -- settings that apply to float position only
size = {
height = '80%',
width = '50%',
},
position = '50%', -- 50% means center it
-- you can also specify border here, if you want a different setting from
-- the global popup_border_style.
},
enable_git_status = false,
-- Mappings for tree window. See `:h nep-tree-mappings` for a list of built-in commands.
-- You can also create your own commands by providing a function instead of a string.
mappings = {
['<space>'] = 'toggle_node',
['<2-LeftMouse>'] = 'open',
['<cr>'] = 'open',
['s'] = 'open_split',
['v'] = 'open_vsplit',
['C'] = 'close_node',
['z'] = 'close_all_nodes',
['R'] = 'refresh',
['a'] = 'add',
['A'] = 'add_directory',
['d'] = 'delete',
['r'] = 'rename',
['y'] = 'copy_to_clipboard',
['x'] = 'cut_to_clipboard',
['p'] = 'paste_from_clipboard',
['c'] = 'copy', -- takes text input for destination
['m'] = 'move', -- takes text input for destination
['q'] = 'close_window',
},
},
filesystem = {
filtered_items = {
hide_dotfiles = false,
hide_gitignored = false,
},
},
source_selector = {
winbar = true,
statusline = false
}
}
}

161
lua/plugins/telescope.lua Normal file
View File

@ -0,0 +1,161 @@
return {
'nvim-telescope/telescope.nvim',
dependencies = {
'nvim-lua/plenary.nvim',
'kyazdani42/nvim-web-devicons',
{
'nvim-telescope/telescope-fzf-native.nvim',
'nvim-telescope/telescope-ui-select.nvim',
build = {
'cmake -S. -Bbuild -DCMAKE_BUILD_TYPE=Release -G Ninja', -- On windows add -DCMAKE_C_FLAGS="-target x86_64-w64-mingw32"
'cmake --build build --config Release',
'cmake --install build --prefix build'
},
config = function()
end
},
},
cmd = { "Telescope" },
keys = {
{
'<leader>f',
function()
require("telescope.builtin").find_files({ no_ignore = true })
end,
desc = 'Find file',
},
{
'<leader>g',
function()
Project_files()
end,
desc = 'Find git files',
},
{
'<leader>o',
function()
require("telescope.builtin").oldfiles()
end,
desc = 'Find old files',
},
{
'<leader>h',
function()
require("telescope.builtin").command_history()
end,
desc = 'Open command history',
},
{
'<leader>b',
function()
require("telescope.builtin").buffers()
end,
desc = 'Select buffer',
},
{
'<leader>q',
function()
require("telescope.builtin").quickfix()
end,
desc = 'Quickfix list with telescope',
},
{
'<leader>l',
function()
require("telescope.builtin").live_grep()
end,
desc = 'Search in project',
},
{
'<leader>j',
function()
require("telescope.builtin").jumplist()
end,
desc = 'Open jumplist',
},
{
'<c-f>',
function()
require("telescope.builtin").current_buffer_fuzzy_find()
end,
desc = 'Find in buffer',
},
{
'<leader>d',
function()
require("telescope.builtin").grep_string()
end,
desc = 'Find in workspace',
}
},
config = function()
local actions = require('telescope.actions')
local mappingTab = {
i = {
['<cr>'] = actions.select_tab,
['<C-b>'] = actions.select_default,
},
}
require('telescope').setup({
defaults = {
mappings = {
i = {
['<cr>'] = actions.select_default + actions.center,
['<C-l>'] = actions.send_selected_to_loclist,
['<C-q>'] = actions.smart_send_to_qflist,
},
},
},
pickers = {
-- Your special builtin config goes in here
buffers = {
sort_lastused = true,
theme = 'ivy',
mappings = {
i = {
['<c-w>'] = actions.delete_buffer,
['<cr>'] = actions.select_default,
},
n = {
['<c-w>'] = actions.delete_buffer,
},
},
},
find_files = {
theme = 'ivy',
previewer = false,
},
oldfiles = {
theme = 'ivy',
},
git_files = {
theme = 'ivy',
previewer = false,
},
lsp_references = {
show_line = false;
include_declaration = false,
},
lsp_dynamic_workspace_symbols = {},
},
extensions = {
["ui-select"] = {
require("telescope.themes").get_dropdown {
}
}
}
})
require("telescope").load_extension("ui-select")
Project_files = function()
local opts = {} -- define here if you want to define something
local ok = pcall(require "telescope.builtin".git_files, opts)
if not ok then require "telescope.builtin".find_files(opts) end
end
require('telescope').load_extension('fzf')
end
}

View File

@ -0,0 +1,50 @@
return {
'nvim-treesitter/nvim-treesitter',
build = ':TSUpdate',
config = function()
require('nvim-treesitter.configs').setup({
ensure_installed = 'all',
highlight = {
enable = true
},
rainbow = {
enable = true,
extended_mode = true, -- Also highlight non-bracket delimiters like html tags, boolean or table: lang -> boolean
max_file_lines = nil, -- Do not enable for files with more than n lines, int
-- colors = {}, -- table of hex strings
-- termcolors = {} -- table of colour name strings
},
indent = {
enable = false -- maybe buggy
},
textobjects = {
select = {
enable = true,
-- Automatically jump forward to textobj, similar to targets.vim
lookahead = true,
keymaps = {
-- You can use the capture groups defined in textobjects.scm
["af"] = "@function.outer",
["if"] = "@function.inner",
["ac"] = "@class.outer",
["ic"] = "@class.inner",
},
},
lsp_interop = {
enable = true,
border = 'none',
peek_definition_code = {
["<leader>df"] = "@function.outer",
["<leader>dF"] = "@class.outer",
},
},
},
})
local parser = require('nvim-treesitter.parsers').filetype_to_parsername
parser.groovy = 'java' -- the someft filetype will use the python parser and queries.
require("nvim-treesitter.install").prefer_git = true
end
}