mirror of
https://git.disroot.org/FollieHiyuki/dotfiles.git
synced 2024-11-28 10:18:25 -05:00
neovim: add more config
This commit is contained in:
parent
0098bc351f
commit
e03162b21a
@ -35,8 +35,8 @@ local load_core = function()
|
||||
disable_distribution_plugins()
|
||||
leader_map()
|
||||
require('plugins')
|
||||
require('events').load_autocmds()
|
||||
require('mappings')
|
||||
require('events').load_autocmds()
|
||||
end
|
||||
|
||||
load_core()
|
||||
|
@ -179,6 +179,12 @@ function M.highlight()
|
||||
vim.cmd('hi! link asciidocQuotedUnconstrainedEmphasized asciidocQuotedEmphasized')
|
||||
vim.cmd('hi! link asciidocURL markdownLinkText')
|
||||
|
||||
hi('awkCharClass', c.teal, '', '', '')
|
||||
hi('awkPatterns' , c.blue, '', '', '')
|
||||
vim.cmd('hi! link awkArrayElement Identifier')
|
||||
vim.cmd('hi! link awkBoolLogic Keyword')
|
||||
vim.cmd('hi! link awkBrktRegExp SpecialChar')
|
||||
|
||||
hi('DiffAdd' , c.green , c.grey1, '', '')
|
||||
hi('DiffChange', c.yellow, c.grey1, '', '')
|
||||
hi('DiffDelete', c.red , c.grey1, '', '')
|
||||
@ -197,6 +203,15 @@ function M.highlight()
|
||||
hi('DashboardCenter' , c.blue , '', 'bold' , '')
|
||||
hi('DashboardShortcut', c.grey_bright, '', 'bold,italic', '')
|
||||
hi('DashboardFooter' , c.green , '', 'bold' , '')
|
||||
|
||||
-- ts-rainbow
|
||||
hi('rainbowcol1', c.red, '', 'bold', '')
|
||||
hi('rainbowcol2', c.orange, '', 'bold', '')
|
||||
hi('rainbowcol3', c.yellow, '', 'bold', '')
|
||||
hi('rainbowcol4', c.green, '', 'bold', '')
|
||||
hi('rainbowcol5', c.cyan, '', 'bold', '')
|
||||
hi('rainbowcol6', c.blue, '', 'bold', '')
|
||||
hi('rainbowcol7', c.purple, '', 'bold', '')
|
||||
end
|
||||
|
||||
return M
|
||||
|
@ -55,12 +55,29 @@ function toggleIndentStyle()
|
||||
end
|
||||
map('n', '<A-t>', ':lua toggleIndentStyle()<CR>', opt)
|
||||
|
||||
-----------------------
|
||||
-- Plugins' bindings --
|
||||
-----------------------
|
||||
-- Move between tabs
|
||||
map('n', '<TAB>', [[<Cmd>BufferLineCycleNext<CR>]], opt)
|
||||
map('n', '<S-TAB>', [[<Cmd>BufferLineCyclePrev<CR>]], opt)
|
||||
|
||||
-- NvimTree
|
||||
map('n', '<C-n>', ':NvimTreeToggle<CR>', opt)
|
||||
|
||||
---------------
|
||||
-- Which-key --
|
||||
---------------
|
||||
local wk = require('which-key')
|
||||
|
||||
-- Don't need to show bufferline numbers
|
||||
wk.register({
|
||||
['<leader>1'] = 'which_key_ignore',
|
||||
['<leader>2'] = 'which_key_ignore',
|
||||
['<leader>3'] = 'which_key_ignore',
|
||||
['<leader>4'] = 'which_key_ignore',
|
||||
['<leader>5'] = 'which_key_ignore',
|
||||
['<leader>6'] = 'which_key_ignore',
|
||||
['<leader>7'] = 'which_key_ignore',
|
||||
['<leader>8'] = 'which_key_ignore',
|
||||
['<leader>9'] = 'which_key_ignore'
|
||||
})
|
||||
|
||||
-- ToggleTerm
|
||||
|
@ -1,13 +1,14 @@
|
||||
return require('colorizer').setup(
|
||||
{'*';},
|
||||
{'*'},
|
||||
{
|
||||
RGB = true; -- #RGB hex codes
|
||||
RRGGBB = true; -- #RRGGBB hex codes
|
||||
names = true; -- "Name" codes like Blue
|
||||
RRGGBBAA = true; -- #RRGGBBAA hex codes
|
||||
rgb_fn = true; -- CSS rgb() and rgba() functions
|
||||
hsl_fn = true; -- CSS hsl() and hsla() functions
|
||||
css = true; -- Enable all CSS features: rgb_fn, hsl_fn, names, RGB, RRGGBB
|
||||
css_fn = true; -- Enable all CSS *functions*: rgb_fn, hsl_fn
|
||||
mode = 'background'; -- Set the display mode.
|
||||
})
|
||||
RGB = true, -- #RGB hex codes
|
||||
RRGGBB = true, -- #RRGGBB hex codes
|
||||
names = true, -- "Name" codes like Blue
|
||||
RRGGBBAA = true, -- #RRGGBBAA hex codes
|
||||
rgb_fn = true, -- CSS rgb() and rgba() functions
|
||||
hsl_fn = true, -- CSS hsl() and hsla() functions
|
||||
css = true, -- Enable all CSS features: rgb_fn, hsl_fn, names, RGB, RRGGBB
|
||||
css_fn = true, -- Enable all CSS *functions*: rgb_fn, hsl_fn
|
||||
mode = 'background' -- Set the display mode.
|
||||
}
|
||||
)
|
||||
|
20
home/.config/nvim/lua/modules/terminal.lua
Normal file
20
home/.config/nvim/lua/modules/terminal.lua
Normal file
@ -0,0 +1,20 @@
|
||||
local M = {}
|
||||
|
||||
M.config = function()
|
||||
require('toggleterm').setup {
|
||||
open_mapping = [[<c-\>]],
|
||||
shade_terminals = false,
|
||||
float_opts = {
|
||||
border = 'curved',
|
||||
width = 80,
|
||||
height = 80,
|
||||
winblend = 3,
|
||||
highlights = {
|
||||
border = 'Normal',
|
||||
background = 'Normal'
|
||||
}
|
||||
}
|
||||
}
|
||||
end
|
||||
|
||||
return M
|
6
home/.config/nvim/lua/modules/treesitter.lua
Normal file
6
home/.config/nvim/lua/modules/treesitter.lua
Normal file
@ -0,0 +1,6 @@
|
||||
return require('nvim-treesitter.configs').setup {
|
||||
ensure_installed = 'maintained',
|
||||
highlight = {
|
||||
enable = true
|
||||
}
|
||||
}
|
7
home/.config/nvim/lua/modules/ts-rainbow.lua
Normal file
7
home/.config/nvim/lua/modules/ts-rainbow.lua
Normal file
@ -0,0 +1,7 @@
|
||||
return require('nvim-treesitter.configs').setup {
|
||||
rainbow = {
|
||||
enable = true,
|
||||
extended_mode = false,
|
||||
max_file_lines = 1000
|
||||
}
|
||||
}
|
@ -2,7 +2,7 @@ local opt = vim.opt
|
||||
|
||||
local function load_options()
|
||||
vim.cmd('filetype indent plugin on')
|
||||
vim.cmd('syntax on')
|
||||
vim.cmd('syntax enable')
|
||||
vim.cmd('set iskeyword+=-')
|
||||
|
||||
-- General settings
|
||||
|
@ -38,17 +38,19 @@ return packer.startup(
|
||||
'kyazdani42/nvim-tree.lua',
|
||||
cmd = 'NvimTreeToggle',
|
||||
setup = function()
|
||||
require('modules.tree')
|
||||
require('modules.nvimtree')
|
||||
end
|
||||
}
|
||||
|
||||
-- Editing
|
||||
use {
|
||||
'norcalli/nvim-colorizer.lua',
|
||||
event = 'BufRead',
|
||||
'folke/which-key.nvim',
|
||||
require('which-key').setup()
|
||||
}
|
||||
|
||||
-- Utils
|
||||
use {
|
||||
'akinsho/nvim-toggleterm.lua',
|
||||
config = function()
|
||||
require('modules.colorizer')
|
||||
vim.cmd('ColorizerReloadAllBuffers')
|
||||
require('modules.terminal').config()
|
||||
end
|
||||
}
|
||||
|
||||
@ -61,6 +63,58 @@ return packer.startup(
|
||||
end
|
||||
}
|
||||
|
||||
-- Highlighting
|
||||
use {
|
||||
'norcalli/nvim-colorizer.lua',
|
||||
event = 'BufRead',
|
||||
config = function()
|
||||
require('modules.colorizer')
|
||||
vim.cmd('ColorizerReloadAllBuffers')
|
||||
end
|
||||
}
|
||||
use {
|
||||
'nvim-treesitter/nvim-treesitter',
|
||||
run = ':TSUpdate',
|
||||
event = 'BufRead',
|
||||
config = function()
|
||||
require('modules.treesitter')
|
||||
end
|
||||
}
|
||||
use {
|
||||
'p00f/nvim-ts-rainbow',
|
||||
after = 'nvim-treesitter',
|
||||
config = function()
|
||||
require('modules.ts-rainbow')
|
||||
end
|
||||
}
|
||||
use {
|
||||
'romgrk/nvim-treesitter-context',
|
||||
after = 'nvim-treesitter'
|
||||
}
|
||||
|
||||
-- LSP
|
||||
use {
|
||||
'neovim/nvim-lspconfig'
|
||||
}
|
||||
use {
|
||||
'kabouzeid/nvim-lspinstall',
|
||||
after = 'nvim-lspconfig'
|
||||
}
|
||||
|
||||
-- Editing
|
||||
use {
|
||||
'terrortylor/nvim-comment',
|
||||
cmd = 'CommentToggle',
|
||||
config = function()
|
||||
require('nvim_comment').setup()
|
||||
end
|
||||
}
|
||||
use {
|
||||
'windwp/nvim-autopairs',
|
||||
event = 'InsertEnter',
|
||||
config = function()
|
||||
require('nvim-autopairs').setup()
|
||||
end
|
||||
}
|
||||
end
|
||||
)
|
||||
|
Loading…
Reference in New Issue
Block a user