modify gitignore, keybinds shade config

This commit is contained in:
juan 2021-09-15 15:18:15 +08:00
parent 6d31cfec51
commit 892f76f591
6 changed files with 169 additions and 145 deletions

2
.gitignore vendored
View File

@ -1,2 +1,2 @@
*.sh *.sh
./plugin/ plugin/*

View File

@ -3,6 +3,7 @@ local opt = vim.o
local global = vim.g local global = vim.g
-- look and feel -- look and feel
vim.opt.shortmess:append({ I = true }) -- remove intro message
opt.relativenumber = true opt.relativenumber = true
opt.number = true opt.number = true
opt.showmode = false opt.showmode = false
@ -19,8 +20,10 @@ opt.smartindent = true
opt.mouse = "i" opt.mouse = "i"
-- completion for lua -- completion for lua
opt.completeopt = 'menuone,noselect' opt.completeopt = 'noinsert'
-- neoformat settings. -- neoformat settings.
global.neoformat_basic_format_align = 1 global.neoformat_basic_format_align = 1
global.neoformat_basic_format_trim = 1 global.neoformat_basic_format_trim = 1
-- leader settings
global.mapleader = ' '

View File

@ -1,5 +1,4 @@
-- generic mappings -- generic mappings
vim.api.nvim_set_keymap('v', '<', '<gv', {noremap = true}) vim.api.nvim_set_keymap('v', '<', '<gv', {noremap = true})
vim.api.nvim_set_keymap('v', '>', '>gv', {noremap = true}) vim.api.nvim_set_keymap('v', '>', '>gv', {noremap = true})
vim.api.nvim_set_keymap('n', 'Y', 'y$', {noremap = true}) vim.api.nvim_set_keymap('n', 'Y', 'y$', {noremap = true})
@ -21,3 +20,20 @@ vim.api.nvim_set_keymap('i', ',', ',<c-g>u', {noremap = true})
vim.api.nvim_set_keymap('i', '.', '.<c-g>u', {noremap = true}) vim.api.nvim_set_keymap('i', '.', '.<c-g>u', {noremap = true})
vim.api.nvim_set_keymap('i', '!', '!<c-g>u', {noremap = true}) vim.api.nvim_set_keymap('i', '!', '!<c-g>u', {noremap = true})
vim.api.nvim_set_keymap('i', '?', '?<c-g>u', {noremap = true}) vim.api.nvim_set_keymap('i', '?', '?<c-g>u', {noremap = true})
-- plugin mappings
-- toggle NvimTree
vim.api.nvim_set_keymap('', '<C-n>', ':NvimTreeToggle<cr>', {})
-- toggle formatter
vim.api.nvim_set_keymap('', '<leader>fm', ':Neoformat<cr>', {})
vim.api.nvim_set_keymap('', '<leader>/', ':CommentToggle<cr>', {})
vim.api.nvim_set_keymap('', '<leader>r', ':SnipRun<cr>', {})
vim.api.nvim_set_keymap('', '<leader>b', ':HopWordBC<cr>', {})
vim.api.nvim_set_keymap('', '<leader>w', ':HopWordAC<cr>', {})
vim.api.nvim_set_keymap('', '<leader>k', ':HopLineStartBC<cr>', {})
vim.api.nvim_set_keymap('', '<leader>j', ':HopLineStartAC<cr>', {})
vim.api.nvim_set_keymap('', '<leader>tf', ':Telescope fd<cr>', {})
vim.api.nvim_set_keymap('', '<leader>tdd',
':Telescope lsp_document_diagnostics<cr>', {})
vim.api.nvim_set_keymap('', '<leader>tdw',
':Telescope lsp_workspace_diagnostics<cr>', {})

View File

@ -2,147 +2,153 @@
vim.cmd [[packadd packer.nvim]] vim.cmd [[packadd packer.nvim]]
require('packer').init { require('packer').init {
display = { display = {
open_fn = function() open_fn = function()
return require("packer.util").float {border = "single"} return require("packer.util").float {border = "single"}
end, end,
prompt_border = "single" prompt_border = "single"
}, },
git = { git = {
clone_timeout = 600 -- Timeout, in seconds, for git clones clone_timeout = 600 -- Timeout, in seconds, for git clones
}, },
auto_clean = true, auto_clean = true,
compile_on_sync = true compile_on_sync = true
-- auto_reload_compiled = true -- auto_reload_compiled = true
} }
return require('packer').startup(function(use) return require('packer').startup(function(use)
use {'wbthomason/packer.nvim', event = 'VimEnter'} use {'wbthomason/packer.nvim', event = 'VimEnter'}
-- core UI -- core UI
use {'kyazdani42/nvim-web-devicons', after = 'packer.nvim'} use {'kyazdani42/nvim-web-devicons', after = 'packer.nvim'}
use { use {
'hoob3rt/lualine.nvim', 'hoob3rt/lualine.nvim',
after = 'nvim-web-devicons', after = 'nvim-web-devicons',
config = function() require "plugins.statusline" end config = function() require "plugins.statusline" end
} }
use { use {
'RRethy/nvim-base16', 'RRethy/nvim-base16',
event = 'VimEnter', after = 'packer.nvim',
config = function() require "plugins.base16" end config = function() require "plugins.base16" end
} }
-- lsp stuff -- lsp stuff
use { use {
'nvim-treesitter/nvim-treesitter', 'nvim-treesitter/nvim-treesitter',
event = 'VimEnter', event = 'VimEnter',
config = function() require "plugins.treesitter" end, config = function() require "plugins.treesitter" end,
run = ':TSUpdate' run = ':TSUpdate'
} }
use { use {
'lewis6991/spellsitter.nvim', 'lewis6991/spellsitter.nvim',
after = "nvim-treesitter", after = "nvim-treesitter",
config = function() require('spellsitter').setup() end config = function() require('spellsitter').setup() end
} }
use {'neovim/nvim-lspconfig', after = "coq_nvim"} use {'neovim/nvim-lspconfig', after = "coq_nvim"}
use { use {
'kabouzeid/nvim-lspinstall', 'kabouzeid/nvim-lspinstall',
config = function() require "plugins.lspinstall" end, config = function() require "plugins.lspinstall" end,
after = 'nvim-lspconfig' after = 'nvim-lspconfig'
} }
use { use {
'ms-jpq/coq_nvim', 'ms-jpq/coq_nvim',
branch = 'coq', branch = 'coq',
event = 'BufEnter', event = 'BufEnter',
config = function() require "plugins.coq" end run = ':COQdeps',
} config = function() require "plugins.coq" end
use {'ms-jpq/coq.artifacts', after = 'coq_nvim', branch = 'artifacts'} }
use {
'ms-jpq/coq.artifacts',
run = ':COQdeps',
after = 'coq_nvim',
branch = 'artifacts'
}
-- formating and editing -- formating and editing
use {"sbdchd/neoformat", cmd = "Neoformat"} use {"sbdchd/neoformat", cmd = "Neoformat"}
use { use {
"mattn/emmet-vim", "mattn/emmet-vim",
event = "FileType html,css", event = "FileType html,css",
setup = function() require "plugins.emmet" end setup = function() require "plugins.emmet" end
} }
use {"machakann/vim-sandwich", event = "BufRead"} use {"machakann/vim-sandwich", event = "BufRead"}
use { use {
"terrortylor/nvim-comment", "terrortylor/nvim-comment",
config = function() require('nvim_comment').setup() end, config = function() require('nvim_comment').setup() end,
cmd = "CommentToggle" cmd = "CommentToggle"
} }
use { use {
"windwp/nvim-autopairs", "windwp/nvim-autopairs",
after = "coq_nvim", after = "coq_nvim",
config = function() require("plugins.nvim-autopairs") end config = function() require("plugins.nvim-autopairs") end
} }
-- navigation -- navigation
use { use {
'kyazdani42/nvim-tree.lua', 'kyazdani42/nvim-tree.lua',
cmd = 'NvimTreeToggle', cmd = 'NvimTreeToggle',
requires = 'kyazdani42/nvim-web-devicons' requires = 'kyazdani42/nvim-web-devicons'
} }
use { use {
"vimwiki/vimwiki", "vimwiki/vimwiki",
cmd = "VimwikiIndex", cmd = "VimwikiIndex",
setup = function() require "plugins.vimwiki" end setup = function() require "plugins.vimwiki" end
} }
use { use {
'andymass/vim-matchup', 'andymass/vim-matchup',
after = 'nvim-treesitter', after = 'nvim-treesitter',
config = function() require "plugins.matchup" end config = function() require "plugins.matchup" end
} }
use { use {
'nvim-telescope/telescope.nvim', 'nvim-telescope/telescope.nvim',
requires = {{'nvim-lua/plenary.nvim'}}, requires = {{'nvim-lua/plenary.nvim'}},
cmd = 'Telescope' cmd = 'Telescope'
} }
use { use {
'phaazon/hop.nvim', 'phaazon/hop.nvim',
event = "BufRead", event = "BufRead",
as = 'hop', as = 'hop',
config = function() config = function()
require'hop'.setup {keys = 'etovxqpdygfblzhckisuran'} require'hop'.setup {keys = 'etovxqpdygfblzhckisuran'}
end end
} }
-- eye-candy -- eye-candy
use { use {
'sunjon/shade.nvim', 'sunjon/shade.nvim',
event = "BufAdd", event = "VimEnter",
config = function() require "plugins.shade" end config = function() require "plugins.shade" end
} }
use { use {
"lukas-reineke/indent-blankline.nvim", "lukas-reineke/indent-blankline.nvim",
after = {"nvim-treesitter", "nvim-base16"}, after = {"nvim-treesitter", "nvim-base16"},
config = function() require "plugins.indent-blankline" end config = function() require "plugins.indent-blankline" end
} }
use { use {
'lewis6991/gitsigns.nvim', 'lewis6991/gitsigns.nvim',
requires = {'nvim-lua/plenary.nvim'}, requires = {'nvim-lua/plenary.nvim'},
config = function() require('gitsigns').setup() end config = function() require('gitsigns').setup() end
} }
use { use {
'p00f/nvim-ts-rainbow', 'p00f/nvim-ts-rainbow',
after = "nvim-treesitter", after = "nvim-treesitter",
config = function() require "plugins.nvim-ts-rainbow" end config = function() require "plugins.nvim-ts-rainbow" end
} }
use { use {
'winston0410/range-highlight.nvim', 'winston0410/range-highlight.nvim',
event = "BufRead", event = "BufRead",
config = function() require("range-highlight").setup {} end, config = function() require("range-highlight").setup {} end,
requires = 'winston0410/cmd-parser.nvim' requires = 'winston0410/cmd-parser.nvim'
} }
use { use {
'norcalli/nvim-colorizer.lua', 'norcalli/nvim-colorizer.lua',
event = "BufRead", event = "BufRead",
config = function() require'colorizer'.setup() end config = function() require'colorizer'.setup() end
} }
-- integrations -- integrations
use {'michaelb/sniprun', run = 'bash ./install.sh', cmd = "SnipRun"} use {'michaelb/sniprun', run = 'bash ./install.sh', cmd = "SnipRun"}
use {"tpope/vim-fugitive", cmd = "G"} use {"tpope/vim-fugitive", cmd = "G"}
end) end)

View File

@ -1,7 +1,4 @@
require'shade'.setup({ require'shade'.setup({
overlay_opacity = 50, overlay_opacity = 70,
opacity_step = 1, keys = {toggle = '<Leader>s'}
keys = {
toggle = '<Leader>s',
}
}) })

View File

@ -141,6 +141,9 @@ _G.packer_plugins = {
["nvim-base16"] = { ["nvim-base16"] = {
after = { "indent-blankline.nvim" }, after = { "indent-blankline.nvim" },
config = { "\27LJ\1\2.\0\0\2\0\2\0\0044\0\0\0%\1\1\0>\0\2\1G\0\1\0\19plugins.base16\frequire\0" }, config = { "\27LJ\1\2.\0\0\2\0\2\0\0044\0\0\0%\1\1\0>\0\2\1G\0\1\0\19plugins.base16\frequire\0" },
load_after = {
["packer.nvim"] = true
},
loaded = false, loaded = false,
needs_bufread = false, needs_bufread = false,
path = "/home/juan/.local/share/nvim/site/pack/packer/opt/nvim-base16" path = "/home/juan/.local/share/nvim/site/pack/packer/opt/nvim-base16"
@ -208,7 +211,7 @@ _G.packer_plugins = {
path = "/home/juan/.local/share/nvim/site/pack/packer/opt/nvim-web-devicons" path = "/home/juan/.local/share/nvim/site/pack/packer/opt/nvim-web-devicons"
}, },
["packer.nvim"] = { ["packer.nvim"] = {
after = { "nvim-web-devicons" }, after = { "nvim-web-devicons", "nvim-base16" },
loaded = false, loaded = false,
needs_bufread = false, needs_bufread = false,
path = "/home/juan/.local/share/nvim/site/pack/packer/opt/packer.nvim" path = "/home/juan/.local/share/nvim/site/pack/packer/opt/packer.nvim"
@ -308,11 +311,10 @@ vim.cmd [[augroup packer_load_aucmds]]
vim.cmd [[au!]] vim.cmd [[au!]]
-- Event lazy-loads -- Event lazy-loads
time([[Defining lazy-load event autocommands]], true) time([[Defining lazy-load event autocommands]], true)
vim.cmd [[au BufRead * ++once lua require("packer.load")({'vim-sandwich', 'nvim-colorizer.lua', 'range-highlight.nvim', 'hop'}, { event = "BufRead *" }, _G.packer_plugins)]]
vim.cmd [[au BufAdd * ++once lua require("packer.load")({'shade.nvim'}, { event = "BufAdd *" }, _G.packer_plugins)]]
vim.cmd [[au VimEnter * ++once lua require("packer.load")({'nvim-treesitter', 'packer.nvim', 'nvim-base16'}, { event = "VimEnter *" }, _G.packer_plugins)]]
vim.cmd [[au FileType html,css ++once lua require("packer.load")({'emmet-vim'}, { event = "FileType html,css" }, _G.packer_plugins)]]
vim.cmd [[au BufEnter * ++once lua require("packer.load")({'coq_nvim'}, { event = "BufEnter *" }, _G.packer_plugins)]] vim.cmd [[au BufEnter * ++once lua require("packer.load")({'coq_nvim'}, { event = "BufEnter *" }, _G.packer_plugins)]]
vim.cmd [[au FileType html,css ++once lua require("packer.load")({'emmet-vim'}, { event = "FileType html,css" }, _G.packer_plugins)]]
vim.cmd [[au VimEnter * ++once lua require("packer.load")({'nvim-treesitter', 'packer.nvim', 'shade.nvim'}, { event = "VimEnter *" }, _G.packer_plugins)]]
vim.cmd [[au BufRead * ++once lua require("packer.load")({'vim-sandwich', 'nvim-colorizer.lua', 'range-highlight.nvim', 'hop'}, { event = "BufRead *" }, _G.packer_plugins)]]
time([[Defining lazy-load event autocommands]], false) time([[Defining lazy-load event autocommands]], false)
vim.cmd("augroup END") vim.cmd("augroup END")
if should_profile then save_profiles() end if should_profile then save_profiles() end