neovim: add zem-mode + symbol-outline

This commit is contained in:
Hoang Nguyen 2021-07-19 19:40:54 +03:00
parent be9665b0e6
commit 2501edc0ea
No known key found for this signature in database
GPG Key ID: 813CF484F4993419
5 changed files with 67 additions and 25 deletions

View File

@ -123,8 +123,8 @@ wk.register({
name = 'Buffer',
c = {':ColorizerToggle<CR>', 'Colorizer'},
d = {':bdelete<CR>', 'Close buffer'},
f = {':NnnPicker %:p:h<CR>', 'File picker'},
n = {':DashboardNewFile<CR>', 'New file'}
n = {':DashboardNewFile<CR>', 'New file'},
z = {':ZenMode<CR>', 'Zen mode'}
},
-- Telescope
@ -153,6 +153,26 @@ wk.register({
z = {':Telescope registers<CR>', 'Vim registers'}
},
-- Git
g = {
name = 'Git',
b = 'Blame current line',
p = 'Preview hunk',
r = 'Reset hunk',
R = 'Reset all hunks in buffer',
s = 'Stage hunk',
u = 'Undo hunk',
n = {':Neogit<CR>', 'Neogit'},
f = {
name = 'Telescope',
a = {':Telescope git_stash<CR>', 'Stash'},
b = {':Telescope git_bcommits<CR>', 'Buffer commits'},
c = {':Telescope git_commits<CR>', 'Commits'},
m = {':Telescope git_branches<CR>', 'Branches'},
s = {':Telescope git_status<CR>', 'Status'}
}
},
l = {
name = 'LSP',
a = 'Add workspace folder',
@ -177,6 +197,7 @@ wk.register({
s = {':Telescope lsp_document_symbols<CR>', 'Buffer symbols'},
S = {':Telescope lsp_workspace_symbols<CR>', 'Workspace symbols'}
},
g = {':SymbolsOutline<CR>', 'Symbol outline'},
D = {'<Cmd>TroubleToggle lsp_definitions<CR>', 'Definition list'},
E = {'<Cmd>TroubleToggle lsp_document_diagnostics<CR>', 'Document diagnostics list'},
W = {'<Cmd>TroubleToggle lsp_workspace_diagnostics<CR>', 'Workspace diagnostics list'},
@ -184,25 +205,7 @@ wk.register({
Q = {'<Cmd>TroubleToggle quickfix<CR>', 'Quickfix list'}
},
-- Git
g = {
name = 'Git',
b = 'Blame current line',
p = 'Preview hunk',
r = 'Reset hunk',
R = 'Reset all hunks in buffer',
s = 'Stage hunk',
u = 'Undo hunk',
n = {':Neogit<CR>', 'Neogit'},
f = {
name = 'Telescope',
a = {':Telescope git_stash<CR>', 'Stash'},
b = {':Telescope git_bcommits<CR>', 'Buffer commits'},
c = {':Telescope git_commits<CR>', 'Commits'},
m = {':Telescope git_branches<CR>', 'Branches'},
s = {':Telescope git_status<CR>', 'Status'}
}
},
n = {':NnnPicker %:p:h<CR>', 'File picker'},
-- Tab related
t = {

View File

@ -2,7 +2,7 @@ local gl = require('galaxyline')
local gls = gl.section
local condition = require('galaxyline.condition')
gl.short_line_list = {'NvimTree', 'packer'}
gl.short_line_list = {'NvimTree', 'packer', 'Outline'}
local colors = require('colors.' .. vim.g.global_theme).colors

View File

@ -0,0 +1,20 @@
return require('zen-mode').setup {
window = {
options = {
signcolumn = 'no',
number = false,
relativenumber = false,
cursorline = false,
cursorcolumn = false,
foldcolumn = '0'
}
},
on_open = function(win)
vim.cmd('TSContextDisable')
vim.cmd('IndentBlanklineDisable')
end,
on_close = function()
vim.cmd('TSContextEnable')
-- vim.cmd('IndentBlanklineEnable')
end,
}

View File

@ -2,7 +2,7 @@ local opt = vim.opt
local function load_options()
vim.cmd('filetype indent plugin on')
vim.cmd('syntax enable')
vim.cmd('syntax on')
-- vim.cmd('set iskeyword+=-')
-- General settings

View File

@ -140,6 +140,16 @@ return require('packer').startup(
require('modules.lsptrouble')
end
}
use {
'simrat39/symbols-outline.nvim',
cmd = {'SymbolsOutline', 'SymbolsOutlineOpen'},
setup = function()
vim.g.symbols_outline = {
highlight_hovered_item = false,
show_guides = false
}
end
}
use {
'hrsh7th/nvim-compe',
event = 'InsertEnter',
@ -302,6 +312,15 @@ return require('packer').startup(
run = 'npm install --prefix server',
cmd = 'Bracey'
}
use {
'folke/zen-mode.nvim',
cmd = 'ZenMode',
wants = 'twilight.nvim',
requires = {{'folke/twilight.nvim', opt = true}},
config = function()
require('modules.zen')
end
}
use {
'akinsho/nvim-toggleterm.lua',
cmd = 'ToggleTerm',
@ -320,7 +339,7 @@ return require('packer').startup(
end
}
-- TODO: lspsaga, orgmode.nvim, zen-mode.nvim, nvim-lint, format(ter).nvim, rest.nvim,
-- sqls.nvim, symbols-outline.nvim, nvim-spectre, nvim-dap, dial.nvim, asynctasks.nvim
-- TODO: lspsaga, orgmode.nvim, nvim-lint, format(ter).nvim, rest.nvim, sqls.nvim,
-- nvim-spectre, nvim-dap, dial.nvim, asynctasks.nvim
end
)