Merge branch 'master' of git.blakenorth.net/home/git/dotfiles

This commit is contained in:
PowerUser64 2022-01-27 20:50:06 -08:00
commit 581f5255a6
7 changed files with 256 additions and 48 deletions

View file

@ -49,6 +49,7 @@ M.treesitter = function()
"rust",
"toml",
"vim",
"yaml",
},
--ignore_install = { "javascript", "java" }, -- List of parsers to ignore installing
highlight = {
@ -107,8 +108,12 @@ M.cmp = function()
-- nvim-cmp supports additional completion capabilities
local capabilities = vim.lsp.protocol.make_client_capabilities()
capabilities = require('cmp_nvim_lsp').update_capabilities(capabilities)
-- nvim-cmp setup
local cmp = require 'cmp'
-- If you want insert `(` after select function or method item
local cmp_autopairs = require('nvim-autopairs.completion.cmp')
local cmp = require('cmp')
cmp.event:on( 'confirm_done', cmp_autopairs.on_confirm_done({ map_char = { tex = '' } }))
-- add a lisp filetype (wrap my-function), FYI: Hardcoded = { "clojure", "clojurescript", "fennel", "janet" }
cmp_autopairs.lisp[#cmp_autopairs.lisp+1] = "racket" -- nvim-cmp setup
cmp.setup {
mapping = {
['<C-p>'] = cmp.mapping.select_prev_item(),
@ -158,11 +163,9 @@ M.cmp = function()
}),
cmp.setup.cmdline(':', {
sources = cmp.config.sources({
{ name = 'path' }
},
{
{ name = 'cmdline' }
})
{ name = 'path' },
{ name = 'cmdline' }
}),
}),
formatting = {
format = function(entry, vim_item)
@ -182,6 +185,9 @@ M.cmp = function()
return vim_item
end,
},
experimental = {
ghost_text = true,
}
}
end -- <<<

View file

@ -169,6 +169,64 @@ M.neoscroll = function()
end
-- <<<
-- indent_blankline >>>
M.indent_blankline = function()
vim.cmd [[
let g:indent_blankline_show_first_indent_level = v:true
let g:indent_blankline_show_foldtext = v:false
let g:indent_blankline_buftype_exclude = ['terminal']
let g:indent_blankline_use_treesitter = v:true
let g:indent_blankline_show_current_context = v:true
]]
require("indent_blankline").setup {
-- for example, context is off by default, use this to turn it on
show_current_context = true,
show_current_context_start = true,
}
end
-- <<<
-- ZenMode >>>
M.zenmode = function()
-- map :ZM to :ZenMode
vim.cmd 'command! ZM ZenMode'
require("zen-mode").setup {
window = {
backdrop = 1, -- shade the backdrop of the Zen window. Set to 1 to keep the same as Normal
-- height and width can be:
-- * an absolute number of cells when > 1
-- * a percentage of the width / height of the editor when <= 1
-- * a function that returns the width or the height
width = 120, -- width of the Zen window
height = 51-2, -- height of the Zen window
-- by default, no options are changed for the Zen window
-- uncomment any of the options below, or add other vim.wo options you want to apply
options = { -- uncomment to do what the sign says
-- signcolumn = "no", -- signcolumn
number = false, -- number column
-- relativenumber = false, -- relative numbers
-- cursorline = false, -- cursorline
cursorcolumn = false, -- cursor column
-- foldcolumn = "0", -- fold column
-- list = false, -- whitespace characters
},
},
plugins = {
-- disable some global vim options (vim.o...)
-- comment the lines to not apply the options
options = {
enabled = true,
ruler = false, -- disables the ruler text in the cmd line area
showcmd = false, -- disables the command in the last line of the screen
},
twilight = { enabled = true }, -- enable to start Twilight when zen mode opens
gitsigns = { enabled = true }, -- disables git signs
tmux = { enabled = false }, -- disables the tmux statusline
},
}
end
-- <<<
-- Autosession >>>
M.autosession = function()
local opts = {

View file

@ -206,8 +206,7 @@ return require('packer').startup({function()
use { -- Zen mode (:ZenMode or :ZM)
"folke/zen-mode.nvim",
config = function()
vim.cmd 'command! ZM ZenMode'
require("zen-mode").setup()
require('blake.other').zenmode()
end,
}
use { -- dim text outside paragraph or function
@ -224,19 +223,14 @@ return require('packer').startup({function()
-- 'ggandor/lightspeed.nvim',
-- }
use { -- indentline: Line indent indicators
'Yggdroot/indentLine',
'lukas-reineke/indent-blankline.nvim',
config = function()
vim.cmd [[
let g:indentLine_char = ''
let g:indentLine_conceallevel = 1
let g:indentLine_fileTypeExclude = ['markdown', 'help', 'packer']
autocmd TermOpen * IndentLinesDisable
]]
require('blake.other').indent_blankline()
end
}
use { -- targets.vim: fix ci' and other things to work right
'wellle/targets.vim',
}
-- use { -- targets.vim: fix ci' and other things to work right
-- 'wellle/targets.vim',
-- }
-- Conveniences
use { -- Ghost: Web browser integration
@ -251,26 +245,29 @@ return require('packer').startup({function()
vim.api.nvim_set_keymap('n', '<F5>', '<cmd>UndotreeToggle<CR>', { noremap = true, silent = true, })
end
}
-- use { -- Dim inactive window
-- 'sunjon/shade.nvim',
-- config = function()
-- require'shade'.setup({
-- overlay_opacity = 50,
-- opacity_step = 1,
-- keys = {
-- brightness_up = '<C-Up>',
-- brightness_down = '<C-Down>',
-- toggle = '<Leader>s',
-- }
-- })
-- end
-- }
-- use { -- Dim inactive window
-- 'sunjon/shade.nvim',
-- config = function()
-- require'shade'.setup({
-- overlay_opacity = 50,
-- opacity_step = 1,
-- keys = {
-- brightness_up = '<C-Up>',
-- brightness_down = '<C-Down>',
-- toggle = '<Leader>s',
-- }
-- })
-- end
-- }
use { -- Quote pairing
'windwp/nvim-autopairs',
config = function()
require('nvim-autopairs').setup()
end
}
use { -- accelerated jk movement
'rhysd/accelerated-jk'
}
use { -- Alignment
'junegunn/vim-easy-align',
}
@ -285,10 +282,8 @@ return require('packer').startup({function()
-- Only calculate commentstring for tsx filetypes
if vim.bo.filetype == 'typescriptreact' then
local U = require('Comment.utils')
-- Detemine whether to use linewise or blockwise commentstring
local type = ctx.ctype == U.ctype.line and '__default' or '__multiline'
-- Determine the location where to calculate commentstring from
local location = nil
if ctx.ctype == U.ctype.block then
@ -296,7 +291,6 @@ return require('packer').startup({function()
elseif ctx.cmotion == U.cmotion.v or ctx.cmotion == U.cmotion.V then
location = require('ts_context_commentstring.utils').get_visual_start_location()
end
return require('ts_context_commentstring.internal').calculate_commentstring({
key = type,
location = location,
@ -306,6 +300,12 @@ return require('packer').startup({function()
}
end
}
use { -- rhysd: committia: better commit editing window
'rhysd/committia.vim',
}
use { -- rhysd: conflict-marker: mark git conflicts - [x ]x
'rhysd/conflict-marker.vim',
}
-- use { -- lewis6991: spellsitter: Spell checking in treesitter files
-- 'lewis6991/spellsitter.nvim',
-- config = function()

View file

@ -38,7 +38,8 @@ set.showcmd = true
set.signcolumn = 'yes'
set.makeprg = 'make -j$(nproc)'
set.ruler = false
set.listchars = "eol:↴,trail:~,tab:'»',nbsp:␣,space:·"
set.listchars = "trail:~,tab:│ ,nbsp:␣,lead:·,extends:…,precedes:…"
set.list = false
----------------------------------------------
--- Key bindings (needs to be translated?) ---
@ -148,16 +149,16 @@ vim.cmd [[
-- Edit *.bin files as binaries rather than text files (if your file isn't a .bin,
-- make a symlink that points to it with the .bin extension and edit the symlink ;)
vim.cmd [[
augroup Binary
au!
au BufReadPre *.bin let &bin=1
au BufReadPost *.bin if &bin | %!xxd
au BufReadPost *.bin set ft=xxd | endif
au BufWritePre *.bin if &bin | %!xxd -r
au BufWritePre *.bin endif
au BufWritePost *.bin if &bin | %!xxd
au BufWritePost *.bin set nomod | endif
augroup END
augroup Binary
au!
au BufReadPre *.bin let &bin=1
au BufReadPost *.bin if &bin | %!xxd
au BufReadPost *.bin set ft=xxd | endif
au BufWritePre *.bin if &bin | %!xxd -r
au BufWritePre *.bin endif
au BufWritePost *.bin if &bin | %!xxd
au BufWritePost *.bin set nomod | endif
augroup END
]]
-- 'Visual At' plugin (https://github.com/stoeffel/.dotfiles/blob/master/vim/visual-at.vim)