Merge branch 'master' of git.blakenorth.net/home/git/dotfiles
This commit is contained in:
commit
85d460fbac
5 changed files with 95 additions and 54 deletions
|
@ -1,9 +1,9 @@
|
||||||
-- Blake's neovim rc file
|
-- Blake's neovim rc file
|
||||||
|
|
||||||
-- basic settings: ~/.config/nvim/lua/blake/settings.lua
|
|
||||||
require('blake.settings')
|
|
||||||
-- plugins and plugin settings: ~/.config/nvim/lua/blake/plugins.lua
|
-- plugins and plugin settings: ~/.config/nvim/lua/blake/plugins.lua
|
||||||
require('blake.plugins')
|
require('blake.plugins')
|
||||||
|
-- basic settings: ~/.config/nvim/lua/blake/settings.lua
|
||||||
|
require('blake.settings')
|
||||||
|
|
||||||
-- TODO:
|
-- TODO:
|
||||||
-- Plugins to install:
|
-- Plugins to install:
|
||||||
|
|
|
@ -121,6 +121,10 @@ M.cmp = function()
|
||||||
behavior = cmp.ConfirmBehavior.Replace,
|
behavior = cmp.ConfirmBehavior.Replace,
|
||||||
select = false,
|
select = false,
|
||||||
},
|
},
|
||||||
|
['<CR>'] = cmp.mapping.confirm {
|
||||||
|
behavior = cmp.ConfirmBehavior.Replace,
|
||||||
|
-- select = true,
|
||||||
|
},
|
||||||
['<Tab>'] = function(fallback)
|
['<Tab>'] = function(fallback)
|
||||||
if cmp.visible() then
|
if cmp.visible() then
|
||||||
cmp.select_next_item()
|
cmp.select_next_item()
|
||||||
|
@ -138,14 +142,28 @@ M.cmp = function()
|
||||||
},
|
},
|
||||||
sources = {
|
sources = {
|
||||||
{ name = 'path' },
|
{ name = 'path' },
|
||||||
{ name = 'buffer' },
|
|
||||||
{ name = 'calc' },
|
|
||||||
{ name = 'nvim_lsp' },
|
|
||||||
{ name = 'nvim_lua' },
|
{ name = 'nvim_lua' },
|
||||||
{ name = 'spell' },
|
{ name = 'nvim_lsp' },
|
||||||
{ name = 'treesitter' },
|
{ name = 'treesitter' },
|
||||||
|
{ name = 'calc' },
|
||||||
|
{ name = 'spell' },
|
||||||
|
{ name = 'buffer' },
|
||||||
|
{ name = 'cmdline' },
|
||||||
{ name = 'emoji' },
|
{ name = 'emoji' },
|
||||||
},
|
},
|
||||||
|
cmp.setup.cmdline('/', {
|
||||||
|
sources = {
|
||||||
|
{ name = 'buffer' }
|
||||||
|
}
|
||||||
|
}),
|
||||||
|
cmp.setup.cmdline(':', {
|
||||||
|
sources = cmp.config.sources({
|
||||||
|
{ name = 'path' }
|
||||||
|
},
|
||||||
|
{
|
||||||
|
{ name = 'cmdline' }
|
||||||
|
})
|
||||||
|
}),
|
||||||
formatting = {
|
formatting = {
|
||||||
format = function(entry, vim_item)
|
format = function(entry, vim_item)
|
||||||
-- fancy icons and a name of kind
|
-- fancy icons and a name of kind
|
||||||
|
@ -153,12 +171,13 @@ M.cmp = function()
|
||||||
-- set a name for each source
|
-- set a name for each source
|
||||||
vim_item.menu = ({
|
vim_item.menu = ({
|
||||||
path = "[Path]",
|
path = "[Path]",
|
||||||
buffer = "[Buffer]",
|
|
||||||
calc = "[Calc]",
|
|
||||||
nvim_lsp = "[LSP]",
|
|
||||||
nvim_lua = "[Lua]",
|
nvim_lua = "[Lua]",
|
||||||
spell = "[Spell]",
|
nvim_lsp = "[LSP]",
|
||||||
treesitter = "[TS]",
|
treesitter = "[TS]",
|
||||||
|
calc = "[Calc]",
|
||||||
|
spell = "[Spell]",
|
||||||
|
cmdline = "[cmdline]",
|
||||||
|
buffer = "[Buffer]",
|
||||||
})[entry.source.name]
|
})[entry.source.name]
|
||||||
return vim_item
|
return vim_item
|
||||||
end,
|
end,
|
||||||
|
@ -201,6 +220,11 @@ M.lspconfig = function()
|
||||||
buf_set_keymap('n', '<leader>q', '<cmd>lua vim.lsp.diagnostic.set_loclist()<CR>', opts)
|
buf_set_keymap('n', '<leader>q', '<cmd>lua vim.lsp.diagnostic.set_loclist()<CR>', opts)
|
||||||
buf_set_keymap('n', '<leader>f', '<cmd>lua vim.lsp.buf.formatting()<CR>', opts)
|
buf_set_keymap('n', '<leader>f', '<cmd>lua vim.lsp.buf.formatting()<CR>', opts)
|
||||||
end -- <<<
|
end -- <<<
|
||||||
|
local capabilities
|
||||||
|
if cmp ~= nil then -- only load this if cmp is loaded
|
||||||
|
capabilities = require('cmp_nvim_lsp').update_capabilities(vim.lsp.protocol.make_client_capabilities())
|
||||||
|
end
|
||||||
|
|
||||||
-- Load servers >>>
|
-- Load servers >>>
|
||||||
-- Use a loop to conveniently call 'setup' on multiple servers and
|
-- Use a loop to conveniently call 'setup' on multiple servers and
|
||||||
-- map buffer local keybindings when the language server attaches
|
-- map buffer local keybindings when the language server attaches
|
||||||
|
@ -234,7 +258,7 @@ M.lspconfig = function()
|
||||||
end
|
end
|
||||||
|
|
||||||
-- From kickstart.nvim:
|
-- From kickstart.nvim:
|
||||||
if (vim.fn.executable(sumneko_binary) == true) then
|
if (vim.fn.executable(sumneko_binary) == 1) then
|
||||||
-- Make runtime files discoverable to the server
|
-- Make runtime files discoverable to the server
|
||||||
local runtime_path = vim.split(package.path, ';')
|
local runtime_path = vim.split(package.path, ';')
|
||||||
table.insert(runtime_path, 'lua/?.lua')
|
table.insert(runtime_path, 'lua/?.lua')
|
||||||
|
|
|
@ -8,11 +8,14 @@ if fn.empty(fn.glob(install_path)) > 0 then
|
||||||
end
|
end
|
||||||
-- }
|
-- }
|
||||||
|
|
||||||
return require('packer').startup(function()
|
return require('packer').startup({function()
|
||||||
|
|
||||||
-- Packer
|
-- Packer
|
||||||
use { -- packer
|
use { -- packer
|
||||||
'wbthomason/packer.nvim'
|
'wbthomason/packer.nvim',
|
||||||
|
config = function() -- Map :PS to :PackerSync
|
||||||
|
vim.cmd 'command! PS PackerSync'
|
||||||
|
end
|
||||||
}
|
}
|
||||||
|
|
||||||
-- Colors
|
-- Colors
|
||||||
|
@ -25,7 +28,7 @@ return require('packer').startup(function()
|
||||||
use { -- onedark theme
|
use { -- onedark theme
|
||||||
'navarasu/onedark.nvim',
|
'navarasu/onedark.nvim',
|
||||||
config = function()
|
config = function()
|
||||||
vim.g.onedark_transparent_background = true
|
-- vim.g.onedark_transparent_background = true
|
||||||
require('onedark').setup()
|
require('onedark').setup()
|
||||||
end
|
end
|
||||||
}
|
}
|
||||||
|
@ -46,7 +49,7 @@ return require('packer').startup(function()
|
||||||
}
|
}
|
||||||
use { -- Default LSP configs
|
use { -- Default LSP configs
|
||||||
'neovim/nvim-lspconfig',
|
'neovim/nvim-lspconfig',
|
||||||
after = 'nvim-lspinstall',
|
after = {'nvim-lspinstall',},
|
||||||
config = function()
|
config = function()
|
||||||
require('blake.lsp').lspconfig()
|
require('blake.lsp').lspconfig()
|
||||||
end
|
end
|
||||||
|
@ -56,15 +59,16 @@ return require('packer').startup(function()
|
||||||
config = function()
|
config = function()
|
||||||
require('blake.lsp').cmp()
|
require('blake.lsp').cmp()
|
||||||
end,
|
end,
|
||||||
requires = { -- nvim-cmp sources
|
requires = { -- nvim-cmp sources (not required by cmp, but reqired by my configuration)
|
||||||
'hrsh7th/cmp-path',
|
'hrsh7th/cmp-path',
|
||||||
'hrsh7th/cmp-nvim-lsp',
|
|
||||||
'hrsh7th/cmp-buffer',
|
|
||||||
'hrsh7th/cmp-nvim-lua',
|
'hrsh7th/cmp-nvim-lua',
|
||||||
'hrsh7th/cmp-latex-symbols',
|
'hrsh7th/cmp-nvim-lsp',
|
||||||
'hrsh7th/cmp-emoji',
|
'ray-x/cmp-treesitter',
|
||||||
'hrsh7th/cmp-calc',
|
'hrsh7th/cmp-calc',
|
||||||
'hrsh7th/cmp-look',
|
'f3fora/cmp-spell',
|
||||||
|
'hrsh7th/cmp-buffer',
|
||||||
|
'hrsh7th/cmp-cmdline',
|
||||||
|
'hrsh7th/cmp-emoji',
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
use { -- Icons for each entry in the completion menu
|
use { -- Icons for each entry in the completion menu
|
||||||
|
@ -157,6 +161,8 @@ return require('packer').startup(function()
|
||||||
-- Conveniences
|
-- Conveniences
|
||||||
use { -- Web browser integration
|
use { -- Web browser integration
|
||||||
'raghur/vim-ghost',
|
'raghur/vim-ghost',
|
||||||
|
opt = true,
|
||||||
|
cmd = {'GhostStart', 'GhostInstall', 'GhostStop', 'GhostSync', 'GhostToggleSync'},
|
||||||
config = function() -- Map :GS to :GhostStart
|
config = function() -- Map :GS to :GhostStart
|
||||||
vim.cmd 'command! GS GhostStart'
|
vim.cmd 'command! GS GhostStart'
|
||||||
end
|
end
|
||||||
|
@ -200,7 +206,10 @@ return require('packer').startup(function()
|
||||||
if packer_bootstrap then
|
if packer_bootstrap then
|
||||||
require('packer').sync()
|
require('packer').sync()
|
||||||
end -- }
|
end -- }
|
||||||
end)
|
end,
|
||||||
|
config = {
|
||||||
|
display = { open_fn = require('packer.util').float }
|
||||||
|
}})
|
||||||
|
|
||||||
-- vim:fdm=marker:fmr={,}:expandtab:tabstop=3:sw=3
|
-- vim:fdm=marker:fmr={,}:fdl=1:expandtab:tabstop=3:sw=3
|
||||||
|
|
||||||
|
|
|
@ -18,10 +18,9 @@ set.ignorecase = true
|
||||||
set.smartcase = true
|
set.smartcase = true
|
||||||
set.wrap = false
|
set.wrap = false
|
||||||
set.linebreak = true
|
set.linebreak = true
|
||||||
set.syntax = 'on'
|
|
||||||
set.redrawtime = 200
|
set.redrawtime = 200
|
||||||
set.updatetime = 300
|
set.updatetime = 300
|
||||||
set.number = true --relativenumber
|
set.number = true
|
||||||
set.errorbells = false
|
set.errorbells = false
|
||||||
set.encoding = 'UTF-8'
|
set.encoding = 'UTF-8'
|
||||||
set.cursorline = true
|
set.cursorline = true
|
||||||
|
@ -38,27 +37,12 @@ set.showcmd = true
|
||||||
set.signcolumn = 'yes'
|
set.signcolumn = 'yes'
|
||||||
set.makeprg = 'make -j$(nproc)'
|
set.makeprg = 'make -j$(nproc)'
|
||||||
set.ruler = false
|
set.ruler = false
|
||||||
|
set.listchars = "eol:↵,trail:~,tab:>-,nbsp:␣"
|
||||||
|
|
||||||
-- Things that can't be translated to lua
|
----------------------------------------------
|
||||||
vim.cmd 'syntax on'
|
--- Key bindings (needs to be translated?) ---
|
||||||
vim.cmd "let g:markdown_fenced_languages = ['bash=sh', 'javascript', 'cpp=cpp', 'c++=cpp', 'js=javascript', 'json=javascript', 'typescript', 'ts=typescript', 'php', 'html', 'css']"
|
----------------------------------------------
|
||||||
|
|
||||||
--- autocmd's
|
|
||||||
-- Spell check in git commits by default
|
|
||||||
vim.cmd 'autocmd Filetype gitcommit setlocal spell'
|
|
||||||
|
|
||||||
-- Disable spell check in help files
|
|
||||||
vim.cmd 'autocmd FileType help setlocal nospell'
|
|
||||||
vim.cmd 'filetype plugin on'
|
|
||||||
|
|
||||||
-- Automatically disable line numbers when in terminal mode
|
|
||||||
vim.cmd 'autocmd TermOpen * setlocal nospell nonumber norelativenumber'
|
|
||||||
|
|
||||||
-- Automatically toggle relative line numbers
|
|
||||||
--vim.cmd 'autocmd InsertEnter * :set norelativenumber '
|
|
||||||
--vim.cmd 'autocmd InsertLeave * :set relativenumber '
|
|
||||||
|
|
||||||
--- Key bindings
|
|
||||||
vim.cmd 'let mapleader = " "'
|
vim.cmd 'let mapleader = " "'
|
||||||
|
|
||||||
-- *sigh*...
|
-- *sigh*...
|
||||||
|
@ -114,7 +98,28 @@ vim.cmd "vnoremap K :m '<-2<CR>gv=gv"
|
||||||
|
|
||||||
-- Format text with Q, rather than gw
|
-- Format text with Q, rather than gw
|
||||||
vim.cmd 'nnoremap Q gw'
|
vim.cmd 'nnoremap Q gw'
|
||||||
vim.cmd 'colorscheme slate'
|
|
||||||
|
----------------------------------------------
|
||||||
|
--- Things that can't be translated to lua ---
|
||||||
|
----------------------------------------------
|
||||||
|
|
||||||
|
vim.cmd 'syntax enable'
|
||||||
|
vim.cmd "let g:markdown_fenced_languages = [ 'bash=sh', 'javascript', 'cpp=cpp', 'c++=cpp', 'js=javascript', 'json=javascript', 'typescript', 'ts=typescript', 'php', 'html', 'css' ]"
|
||||||
|
|
||||||
|
--- autocmd's ---
|
||||||
|
-- Spell check in git commits by default
|
||||||
|
vim.cmd 'autocmd Filetype gitcommit setlocal spell'
|
||||||
|
|
||||||
|
-- Disable spell check in help files
|
||||||
|
vim.cmd 'autocmd FileType help setlocal nospell'
|
||||||
|
vim.cmd 'filetype plugin on'
|
||||||
|
|
||||||
|
-- Automatically disable line numbers when in terminal mode
|
||||||
|
vim.cmd 'autocmd TermOpen * setlocal nospell nonumber norelativenumber'
|
||||||
|
|
||||||
|
-- Automatically toggle relative line numbers
|
||||||
|
--vim.cmd 'autocmd InsertEnter * :set norelativenumber '
|
||||||
|
--vim.cmd 'autocmd InsertLeave * :set relativenumber '
|
||||||
|
|
||||||
-- 24-bit color
|
-- 24-bit color
|
||||||
vim.cmd [[
|
vim.cmd [[
|
||||||
|
@ -166,9 +171,6 @@ vim.cmd [[
|
||||||
-- Automatically jump to the last position in a file when opening
|
-- Automatically jump to the last position in a file when opening
|
||||||
vim.cmd [[ au BufReadPost * if expand('%:p') !~# '\m/\.git/' && line("'\"") > 1 && line("'\"") <= line("$") | exe "normal! g'\"" | endif ]]
|
vim.cmd [[ au BufReadPost * if expand('%:p') !~# '\m/\.git/' && line("'\"") > 1 && line("'\"") <= line("$") | exe "normal! g'\"" | endif ]]
|
||||||
|
|
||||||
-- Highlight trailing whitespace in red
|
|
||||||
set.listchars = "eol:↵,trail:~,tab:>-,nbsp:␣"
|
|
||||||
|
|
||||||
-- Highlight trailing whitespace in red
|
-- Highlight trailing whitespace in red
|
||||||
vim.cmd [[
|
vim.cmd [[
|
||||||
highlight ExtraWhitespace ctermbg=red guibg=red
|
highlight ExtraWhitespace ctermbg=red guibg=red
|
||||||
|
|
16
.zshrc
16
.zshrc
|
@ -224,6 +224,12 @@
|
||||||
done
|
done
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# edit file: Uses fzy to locate a file, and opens it in your favorite text editor
|
||||||
|
# Takes arguments for `fd`
|
||||||
|
ef() {
|
||||||
|
"$EDITOR" "$(fd $@ | fzy)"
|
||||||
|
}
|
||||||
|
|
||||||
# toggles whether a file or group of files is executable
|
# toggles whether a file or group of files is executable
|
||||||
chx() {
|
chx() {
|
||||||
for FILE in "$@";do
|
for FILE in "$@";do
|
||||||
|
@ -772,16 +778,16 @@ save_working_dir() {
|
||||||
autoload -U add-zsh-hook
|
autoload -U add-zsh-hook
|
||||||
add-zsh-hook chpwd save_working_dir
|
add-zsh-hook chpwd save_working_dir
|
||||||
|
|
||||||
load_working_dir &&
|
load_working_dir && cd - > /dev/null
|
||||||
cd - > /dev/null
|
|
||||||
|
# Case insensitive globbing (fix for termux)
|
||||||
|
[ -n "$TERMUX_VERSION" ] && setopt nocaseglob
|
||||||
|
|
||||||
[ -n "$TERMUX_VERSION" ] &&
|
|
||||||
setopt nocaseglob # Case insensitive globbing (fix for termux)
|
|
||||||
# <<<
|
# <<<
|
||||||
# <<<
|
# <<<
|
||||||
|
|
||||||
# Optionally source the user's customized .zshrc
|
# Optionally source the user's customized .zshrc
|
||||||
[ -f "${XDG_CONFIG_HOME:-$HOME/.config}/shell/zshrc.local" ] && source "${XDG_CONFIG_HOME:-$HOME/.config}/shell/zshrc.local" || return 0
|
[ -f "${XDG_CONFIG_HOME:-$HOME/.config}/shell/zshrc.local" ] && source "${XDG_CONFIG_HOME:-$HOME/.config}/shell/zshrc.local" || true
|
||||||
|
|
||||||
# vim:fdm=marker:fmr=>>>,<<<:et:ft=sh:sw=3
|
# vim:fdm=marker:fmr=>>>,<<<:et:ft=sh:sw=3
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue