]])
let g:auto_save = 0
function BufferAutoSaveToggle()
if exists('b:auto_save')
let b:auto_save = !b:auto_save
else
let b:auto_save = 1
endif
if b:auto_save == 1
echo 'autosave on'
else
echo 'autosave off'
endif
endfunction
command BufferAutoSave call BufferAutoSaveToggle()
nnoremap <leader>a :BufferAutoSave<cr>
let g:yey = 0
function YeyOn()
let g:yey = 1
:nmap j jzz
:nmap k kzz
:nmap G Gzz
:echo 'yey on'
endfunction
function YeyOff()
let g:yey = 0
:unmap j
:unmap k
:unmap G
:echo 'yey off'
endfunction
function YeyToggle()
if g:yey == 0
:call YeyOn()
else
:call YeyOff()
endif
endfunction
command Yey call YeyToggle()
nnoremap <leader>Y :Yey<cr>
endfunction
command Focus call FocusToggle()
nnoremap <leader>O :Focus<cr>
:silent! call YeyOff()
:Goyo!
:echo 'focus off'
endif
:silent! call YeyOn()
:Goyo 120
:echo 'focus on'
else
:silent! call FocusOff()
if g:focused == 1
:silent! call FocusOn()
:silent! call NumbersOff()
let g:focused = 1 - g:focused
let g:focused = 0
function FocusToggle()
let g:limelight_priority = -1
nnoremap <leader>L :Limelight!!<cr>
nnoremap <leader>I :IlluminateToggleBuf<cr>
let g:limelight_bop = '^\n'
let g:limelight_eop = '^\n'
let g:limelight_paragraph_span = 0
let g:limelight_default_coefficient = 1.0
let g:limelight_conceal_guifg = '#666666'
let g:limelight_conceal_ctermfg = 240
vim.cmd([[
vim.pack.add({
'https://github.com/junegunn/goyo.vim',
'https://github.com/junegunn/limelight.vim',
'https://github.com/907th/vim-auto-save',
})
vim.cmd("packadd nvim.undotree")
vim.keymap.set("n", "<leader>u", require("undotree").open)
-- vim.pack.add({ 'https://github.com/mbbill/undotree' })
-- vim.g.undotree_WindowLayout = 2
-- vim.g.undotree_ShortIndicators = 1
-- vim.g.undotree_SplitWidth = 29
-- vim.g.undotree_DiffpanelHeight = 10
-- vim.g.undotree_DiffAutoOpen = 1
-- vim.g.undotree_SetFocusWhenToggle = 1
-- vim.g.undotree_TreeNodeShape = '*'
-- vim.g.undotree_TreeVertShape = '|'
-- vim.g.undotree_TreeSplitShape = '/'
-- vim.g.undotree_TreeReturnShape = '\\'
-- vim.g.undotree_DiffCommand = 'diff -s'
-- vim.g.undotree_RelativeTimestamp = 1
-- vim.g.undotree_HighlightChangedText = 1
-- vim.g.undotree_HighlightChangedWithSign = 1
-- vim.g.undotree_HighlightSyntaxAdd = 'DiffAdd'
-- vim.g.undotree_HighlightSyntaxChange = 'DiffChange'
-- vim.g.undotree_HighlightSyntaxDel = 'DiffDelete'
-- vim.g.undotree_HelpLine = 1
-- vim.g.undotree_CursorLine = 1
-- vim.keymap.set('n', '<leader>u', '<cmd>UndotreeToggle<cr>', opts)
-- vim.keymap.set('n', '<C-w>u', '<cmd>UndotreeShow | UndotreeFocus<cr>', opts)
-- vim.keymap.set('n', '<C-w>U', '<cmd>UndotreeHide<cr>', opts)
-- vim.keymap.set('n', '<C-w><C-u>', '<cmd>UndotreeShow<cr>', opts)
mode = 'background',
RGB = true,
RRGGBB = true,
names = false,
RRGGBBAA = true,
rgb_fn = true,
hsl_fn = true,
css = false,
css_fn = false,
}
)
vim.api.nvim_create_autocmd('TextChanged', { command = 'ColorizerAttachToBuffer' })
{
vim.pack.add({ 'https://github.com/RRethy/vim-illuminate' })
require('illuminate').configure({
providers = { 'lsp', 'treesitter', 'regex' },
delay = 9,
filetypes_denylist = { 'dirbuf', 'dirvish', 'fugitive' },
under_cursor = true,
min_count_to_highlight = 1,
should_enable = function(bufnr) return true end,
case_insensitive_regex = false,
})
vim.pack.add({ 'https://github.com/jiangmiao/auto-pairs' })
vim.g.AutoPairs = { ['('] = ')', ['['] = ']', ['{'] = '}', ['"'] = '"', ['```'] = '```', ['"""'] = '"""', ["'''"] = "'''", ['`'] = '`' }
vim.g.AutoPairsMultilineClose = 0
vim.g.accent_colour = 'cyan'
vim.g.accent_darken = 1
vim.g.accent_invert_status = 0
vim.g.accent_auto_cwd_colour = 1
vim.g.accent_no_bg = 1
-- color schemes
vim.pack.add({
'https://github.com/alligator/accent.vim',
'https://github.com/kadekillary/skull-vim',
'https://github.com/lokaltog/vim-monotone',
'https://github.com/arcticicestudio/nord-vim',
'https://github.com/hardselius/warlock',
'https://github.com/sainnhe/everforest',
'https://github.com/logico/typewriter-vim',
'https://github.com/reedes/vim-colors-pencil',
'https://github.com/junegunn/seoul256.vim',
'https://github.com/sainnhe/gruvbox-material',
'https://github.com/EdenEast/nightfox.nvim',
'https://github.com/nordtheme/vim',
'https://github.com/joshdick/onedark.vim',
'https://github.com/folke/tokyonight.nvim',
'https://github.com/morhetz/gruvbox',
})
local opts = { noremap = true, silent = true }
vim.o.clipboard = 'unnamedplus'
-- vim.o.autocomplete = true
vim.opt.winborder = 'none'
vim.opt.winblend = 10
vim.opt.completeopt = { 'menuone', 'noselect', 'popup' }
vim.opt.undodir = vim.fn.expand('~/.config/nvim/undo')
vim.opt.termguicolors = true
vim.cmd.source('~/.vim/vimrc')
vim.g.mapleader = ' '
vim.g.maplocalleader = ' '