Skip to content

Commit

Permalink
WIP on lazy
Browse files Browse the repository at this point in the history
  • Loading branch information
gouflv committed Feb 6, 2023
1 parent 094df6e commit a903187
Show file tree
Hide file tree
Showing 32 changed files with 199 additions and 20 deletions.
3 changes: 1 addition & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
packer_compiled.lua
lua/.DS_Store
.DS_Store
2 changes: 1 addition & 1 deletion init.lua
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
require('base')
require('colorscheme')
require('maps')
require('plugins')
require('lazy-init')
13 changes: 13 additions & 0 deletions lazy-lock.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"alpha-nvim": { "branch": "main", "commit": "21a0f2520ad3a7c32c0822f943368dc063a569fb" },
"bufferline.nvim": { "branch": "main", "commit": "c7492a76ce8218e3335f027af44930576b561013" },
"gruvbox": { "branch": "master", "commit": "bf2885a95efdad7bd5e4794dd0213917770d79b7" },
"lazy.nvim": { "branch": "main", "commit": "3d2dcb2d5ef99106c5ff412da88c6f59a9f8a693" },
"lualine.nvim": { "branch": "master", "commit": "0050b308552e45f7128f399886c86afefc3eb988" },
"neo-tree.nvim": { "branch": "v2.x", "commit": "8238865e1d9c61f1a260c290653f2c419503e0a9" },
"nui.nvim": { "branch": "main", "commit": "d147222a1300901656f3ebd5b95f91732785a329" },
"nvim-web-devicons": { "branch": "master", "commit": "2b96193abe4372e18e4f4533895a42a466d53c17" },
"plenary.nvim": { "branch": "master", "commit": "9a0d3bf7b832818c042aaf30f692b081ddd58bd9" },
"vim-bbye": { "branch": "master", "commit": "25ef93ac5a87526111f43e5110675032dbcacf56" },
"vim-repeat": { "branch": "master", "commit": "24afe922e6a05891756ecf331f39a1f6743d3d5a" }
}
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
6 changes: 3 additions & 3 deletions lua/config/treesitter.lua → lua/config.bak/treesitter.lua
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ treesitter.setup({

treesitter_context.setup({})

-- vim.opt.foldlevelstart = 3
vim.opt.foldlevelstart = 99
-- vim.opt.foldlevel = 3
-- vim.opt.foldmethod = 'expr'
-- vim.opt.foldexpr = 'nvim_treesitter#foldexpr()'
vim.opt.foldmethod = 'expr'
vim.opt.foldexpr = 'nvim_treesitter#foldexpr()'
File renamed without changes.
File renamed without changes.
14 changes: 14 additions & 0 deletions lua/lazy-init.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
if not vim.loop.fs_stat(lazypath) then
vim.fn.system({
"git",
"clone",
"--filter=blob:none",
"https://github.com/folke/lazy.nvim.git",
"--branch=stable", -- latest stable release
lazypath,
})
end
vim.opt.rtp:prepend(lazypath)

require("lazy").setup("plugins", {})
26 changes: 15 additions & 11 deletions lua/lsp/lspsaga.lua
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,17 @@ local map = require('utils').map

local saga = require('lspsaga')

local saga_diagnostic = require('lspsaga.diagnostic')

saga.init_lsp_saga({
code_action_icon = '',
code_action_keys = { quit = '<Esc>', exec = '<CR>' },
finder_request_timeout = 3000,
rename_in_select = false,
saga.setup({
request_timeout = 3000,
lightbulb = {
enable = false,
},
code_action = {
keys = { quit = '<Esc>', exec = '<CR>' }
},
rename = {
in_select = false
}
})

local goto_opts = { severity = vim.diagnostic.severity.ERROR }
Expand All @@ -18,7 +22,7 @@ map('n', 'gr', '<cmd>Lspsaga lsp_finder<CR>')
map('n', 'gpd', '<cmd>Lspsaga peek_definition<CR>')
map('n', 'ga', '<cmd>Lspsaga code_action<CR>')
map('n', 'rn', '<cmd>Lspsaga rename<CR>')
map('n', '[e', function() saga_diagnostic.goto_prev(goto_opts) end, 'Goto previous error')
map('n', ']e', function() saga_diagnostic.goto_next(goto_opts) end, 'Goto next error')
map('n', '[d', function() saga_diagnostic.goto_prev() end, 'Goto previous diagnostic')
map('n', ']d', function() saga_diagnostic.goto_next() end, 'Goto next diagnostic')
map('n', '[e', '<cmd>Lspsaga diagnostic_jump_prev', 'Goto previous error')
map('n', ']e', '<cmd>Lspsaga diagnostic_jump_next', 'Goto previous error')
map('n', '[d', function() require('lspsaga.diagnostic'):goto_prev(goto_opts) end, 'Goto previous diagnostic')
map('n', ']d', function() require('lspsaga.diagnostic'):goto_next(goto_opts) end, 'Goto next diagnostic')
3 changes: 0 additions & 3 deletions lua/maps.lua
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,3 @@ map('n', ':', ';')

-- Terminal
map('t', '<S-Esc>', [[<C-\><C-n>]])

-- Reload
map('n', '<leader>`', ':source $MYVIMRC<CR>')
File renamed without changes.
10 changes: 10 additions & 0 deletions lua/plugins/colorscheme.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
return {
{
'morhetz/gruvbox',
lazy = false,
priority = 1000,
config = function()
vim.cmd([[ colorscheme gruvbox ]])
end
}
}
3 changes: 3 additions & 0 deletions lua/plugins/editor.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
return {

}
132 changes: 132 additions & 0 deletions lua/plugins/ui.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,132 @@
return {

{ 'kyazdani42/nvim-web-devicons', lazy = true },

{ 'moll/vim-bbye', lazy = true, cmd = 'Bdelete' },

-- file explorer
{
'nvim-neo-tree/neo-tree.nvim',
branch = 'v2.x',
cmd = 'Neotree',
deactivate = function()
vim.cmd([[Neotree close]])
end,
init = function()
vim.g.neo_tree_remove_legacy_commands = 1
if vim.fn.argc() == 1 then
local stat = vim.loop.fs_stat(vim.fn.argv(0))
if stat and stat.type == 'directory' then
require('neo-tree')
end
end
end,
opts = {
window = {
width = 30
},
filesystem = {
filtered_items = {
hide_dotfiles = false,
},
}
},
keys = {
{
'<leader>e',
function()
require('neo-tree.command').execute({
toggle = true
})
end
},
{
'<leader>E',
function()
require('neo-tree.command').execute({
toggle = true,
dir = vim.loop.cwd()
})
end
},
}
},

-- bufferline
{
'akinsho/bufferline.nvim',
event = 'VeryLazy',
opts = {
options = {
show_buffer_close_icons = false,
show_close_icon = false,
offsets = {
{
filetype = 'neo-tree',
highlight = 'Directory',
}
}
}
}
},

-- lualine
{
'nvim-lualine/lualine.nvim',
event = 'VeryLazy',
opts = {
options = {
section_separators = '',
component_separators = ''
},
sections = {
lualine_b = {
{ 'branch', icons_enabled = false, },
'diff',
'diagonstics',
},
lualine_c = {
{ 'filename', file_status = true, path = 1 },
},
lualine_x = {
-- encoding
-- fileformat
{ 'filetype', icons_enabled = false, }
},
lualine_y = {
-- progress
},
-- lualine_z = { 'location' },
},
inactive_sections = {
lualine_c = {
{ 'filename', file_status = true, path = 1 },
},
}
}
},

-- TODO
-- noe-tree

-- dashboard
{
'goolord/alpha-nvim',
event = 'VimEnter',
opts = function()
local dashboard = require('alpha.themes.dashboard')
dashboard.section.buttons.val = {
dashboard.button('fe', 'Explorer', ':NvimTreeOpen <CR>'),
dashboard.button('ff', 'Find file', ':Telescope find_files <CR>'),
dashboard.button('fo', 'Recent', ':Telescope oldfiles <CR>'),
dashboard.button('n', 'New file', ':ene <BAR> startinsert <CR>'),
dashboard.button('q', 'Quit', ':qa<CR>'),
}
return dashboard
end
,
config = function(_, dashboard)
require('alpha').setup(dashboard.opts)
end
}
}
7 changes: 7 additions & 0 deletions lua/plugins/utils.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
return {
{ 'nvim-lua/plenary.nvim', lazy = true },

{ 'tpope/vim-repeat', event = 'VeryLazy' },

{ 'MunifTanjim/nui.nvim', event = 'VeryLazy' },
}

0 comments on commit a903187

Please sign in to comment.