feat: add sneak, quickscope, colorizer, gruvbox, commenter, smoothie
This commit is contained in:
parent
95660c65af
commit
394c2db554
1
init.lua
1
init.lua
@ -24,4 +24,5 @@ require("plugins")
|
|||||||
require("options")
|
require("options")
|
||||||
require("bindings")
|
require("bindings")
|
||||||
|
|
||||||
|
require("themes.gruvbox")
|
||||||
|
|
||||||
|
15
lua/config/colorizer.lua
Normal file
15
lua/config/colorizer.lua
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
require('colorizer').setup(
|
||||||
|
nil,
|
||||||
|
{
|
||||||
|
RGB = true,
|
||||||
|
RRGGBB = true,
|
||||||
|
names = false,
|
||||||
|
RRGGBBAA = true,
|
||||||
|
rgb_fn = true,
|
||||||
|
hsl_fn = true,
|
||||||
|
css = false,
|
||||||
|
css_fn = false,
|
||||||
|
mode = 'background'
|
||||||
|
}
|
||||||
|
)
|
||||||
|
|
8
lua/config/quickscope.lua
Normal file
8
lua/config/quickscope.lua
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
local g = vim.g
|
||||||
|
local cmd = vim.cmd
|
||||||
|
|
||||||
|
-- Trigger a highlight in the appropriate direction when pressing these keys:
|
||||||
|
g['qs_highlight_on_keys'] = {'f', 'F', 't', 'T'}
|
||||||
|
|
||||||
|
g['qs_max_chars'] = 150
|
||||||
|
|
23
lua/config/sneak.lua
Normal file
23
lua/config/sneak.lua
Normal file
@ -0,0 +1,23 @@
|
|||||||
|
local map = require 'utils.map'
|
||||||
|
local g = vim.g
|
||||||
|
|
||||||
|
g['sneak#label'] = 1
|
||||||
|
|
||||||
|
-- case insensitive sneak
|
||||||
|
g['sneak#use_ic_scs'] = 1
|
||||||
|
|
||||||
|
-- immediately move to the next instance of search, if you move the cursor sneak is back to default behavior
|
||||||
|
g['sneak#s_next'] = 1
|
||||||
|
|
||||||
|
-- remap so I can use , and ; with f and t
|
||||||
|
map({'n', 'v'}, 'gS', '<plug>Sneak_;')
|
||||||
|
map({'n', 'v'}, 'gs', '<plug>Sneak_;')
|
||||||
|
-- map gS <Plug>Sneak_,
|
||||||
|
-- map gs <Plug>Sneak_;
|
||||||
|
|
||||||
|
-- highlight Sneak guifg=black guibg=#00C7DF ctermfg=black ctermbg=cyan
|
||||||
|
-- highlight SneakScope guifg=red guibg=yellow ctermfg=red ctermbg=yellow
|
||||||
|
|
||||||
|
-- Emoji prompt
|
||||||
|
g['sneak#prompt'] = '🔎'
|
||||||
|
|
103
lua/plugins.lua
103
lua/plugins.lua
@ -1,16 +1,35 @@
|
|||||||
local function usePlugins(use)
|
local function usePlugins(use)
|
||||||
-- Packer can manage itself
|
-- Packer can manage itself
|
||||||
use 'wbthomason/packer.nvim'
|
use 'wbthomason/packer.nvim'
|
||||||
|
|
||||||
-- Improve startup time when loading lua files.
|
-- Improve startup time when loading lua files.
|
||||||
-- Temporary solution before PR gets merges. https://github.com/neovim/neovim/pull/15436
|
-- Temporary solution before PR gets merges. https://github.com/neovim/neovim/pull/15436
|
||||||
use 'lewis6991/impatient.nvim'
|
use 'lewis6991/impatient.nvim'
|
||||||
|
|
||||||
-- Git integration
|
-- Various lua utilities
|
||||||
use { 'tpope/vim-fugitive', config = [[require 'config.fugitive']] }
|
use 'nvim-lua/plenary.nvim'
|
||||||
|
|
||||||
|
-- Smooth smooth scrolling
|
||||||
|
use 'psliwka/vim-smoothie'
|
||||||
|
|
||||||
|
-- Toggle comments
|
||||||
|
use 'tpope/vim-commentary'
|
||||||
|
|
||||||
|
-- Color code colorizer
|
||||||
|
use { 'norcalli/nvim-colorizer.lua', config = [[require 'config.colorizer']] }
|
||||||
|
|
||||||
|
-- Quick movement
|
||||||
|
use { 'justinmk/vim-sneak', config = [[require 'config.sneak']] }
|
||||||
|
use { 'unblevable/quick-scope', config = [[require 'config.quickscope']] }
|
||||||
|
use 'michaeljsmith/vim-indent-object'
|
||||||
|
|
||||||
|
-- Color themes
|
||||||
|
use { 'morhetz/gruvbox', module = 'themes.gruvbox' }
|
||||||
|
|
||||||
|
-- Git integration
|
||||||
|
use { 'tpope/vim-fugitive', config = [[require 'config.fugitive']] }
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
-- Register custom commands for plugin manager
|
-- Register custom commands for plugin manager
|
||||||
vim.cmd [[command! PackerInstall packadd packer.nvim | lua require('plugins').install()]]
|
vim.cmd [[command! PackerInstall packadd packer.nvim | lua require('plugins').install()]]
|
||||||
vim.cmd [[command! PackerUpdate packadd packer.nvim | lua require('plugins').update()]]
|
vim.cmd [[command! PackerUpdate packadd packer.nvim | lua require('plugins').update()]]
|
||||||
@ -20,55 +39,55 @@ vim.cmd [[command! PackerCompile packadd packer.nvim | lua require('plugins').co
|
|||||||
|
|
||||||
-- Run "PackerCompile" whenever this file is updated
|
-- Run "PackerCompile" whenever this file is updated
|
||||||
vim.cmd [[
|
vim.cmd [[
|
||||||
augroup packer_user_config
|
augroup packer_user_config
|
||||||
autocmd!
|
autocmd!
|
||||||
autocmd BufWritePost plugins.lua source <afile> | PackerCompile
|
autocmd BufWritePost plugins.lua source <afile> | PackerCompile
|
||||||
augroup end
|
augroup end
|
||||||
]]
|
]]
|
||||||
|
|
||||||
-- Bootstrap packer.nvim. If packer.nvim is not installed, install it.
|
-- Bootstrap packer.nvim. If packer.nvim is not installed, install it.
|
||||||
local function bootstrap()
|
local function bootstrap()
|
||||||
local fn = vim.fn
|
local fn = vim.fn
|
||||||
local install_path = fn.stdpath('data')..'/site/pack/packer/start/packer.nvim'
|
local install_path = fn.stdpath('data')..'/site/pack/packer/start/packer.nvim'
|
||||||
local packer_bootstrap
|
local packer_bootstrap
|
||||||
if fn.empty(fn.glob(install_path)) > 0 then
|
if fn.empty(fn.glob(install_path)) > 0 then
|
||||||
return fn.system({'git', 'clone', '--depth', '1', 'https://github.com/wbthomason/packer.nvim', install_path})
|
return fn.system({'git', 'clone', '--depth', '1', 'https://github.com/wbthomason/packer.nvim', install_path})
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
local packer = nil
|
local packer = nil
|
||||||
local function init()
|
local function init()
|
||||||
-- Perform bootstrap
|
-- Perform bootstrap
|
||||||
local packer_bootstrap = bootstrap()
|
local packer_bootstrap = bootstrap()
|
||||||
|
|
||||||
-- Initialize packer
|
-- Initialize packer
|
||||||
if packer == nil then
|
if packer == nil then
|
||||||
packer = require 'packer'
|
packer = require 'packer'
|
||||||
local util = require 'packer.util'
|
local util = require 'packer.util'
|
||||||
packer.init {
|
packer.init {
|
||||||
compile_path = util.join_paths(vim.fn.stdpath('config'), 'plugin', 'packer-compiled.lua'),
|
compile_path = util.join_paths(vim.fn.stdpath('config'), 'plugin', 'packer-compiled.lua'),
|
||||||
disable_commands = true
|
disable_commands = true
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
|
|
||||||
-- Reset plugins if already loaded
|
-- Reset plugins if already loaded
|
||||||
packer.reset()
|
packer.reset()
|
||||||
|
|
||||||
-- Use plugins
|
-- Use plugins
|
||||||
usePlugins(packer.use, packer.use_rocks)
|
usePlugins(packer.use, packer.use_rocks)
|
||||||
|
|
||||||
-- Automatically set up your configuration after cloning packer.nvim
|
-- Automatically set up your configuration after cloning packer.nvim
|
||||||
-- Put this at the end after all plugins
|
-- Put this at the end after all plugins
|
||||||
if packer_bootstrap then
|
if packer_bootstrap then
|
||||||
require('packer').sync()
|
require('packer').sync()
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
local plugins = setmetatable({}, {
|
local plugins = setmetatable({}, {
|
||||||
__index = function(_, key)
|
__index = function(_, key)
|
||||||
init()
|
init()
|
||||||
return packer[key]
|
return packer[key]
|
||||||
end,
|
end,
|
||||||
})
|
})
|
||||||
|
|
||||||
return plugins
|
return plugins
|
||||||
|
19
lua/sneak.lua
Normal file
19
lua/sneak.lua
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
let g:sneak#label = 1
|
||||||
|
|
||||||
|
" case insensitive sneak
|
||||||
|
let g:sneak#use_ic_scs = 1
|
||||||
|
|
||||||
|
" immediately move to the next instance of search, if you move the cursor sneak is back to default behavior
|
||||||
|
let g:sneak#s_next = 1
|
||||||
|
|
||||||
|
" remap so I can use , and ; with f and t
|
||||||
|
map gS <Plug>Sneak_,
|
||||||
|
map gs <Plug>Sneak_;
|
||||||
|
|
||||||
|
" Change the colors
|
||||||
|
" highlight Sneak guifg=black guibg=#00C7DF ctermfg=black ctermbg=cyan
|
||||||
|
" highlight SneakScope guifg=red guibg=yellow ctermfg=red ctermbg=yellow
|
||||||
|
|
||||||
|
" Cool prompts
|
||||||
|
" let g:sneak#prompt = '🕵'
|
||||||
|
let g:sneak#prompt = '🔎'
|
10
lua/themes/gruvbox.lua
Normal file
10
lua/themes/gruvbox.lua
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
local opt = require 'utils.opt'
|
||||||
|
local cmd = vim.cmd
|
||||||
|
|
||||||
|
opt('background', 'dark')
|
||||||
|
cmd [[colorscheme gruvbox]]
|
||||||
|
|
||||||
|
-- Background transparency
|
||||||
|
cmd [[highlight Normal guibg=NONE ctermbg=NONE]]
|
||||||
|
cmd [[highlight Folded guibg=NONE ctermbg=NONE]]
|
||||||
|
|
Loading…
Reference in New Issue
Block a user