Cleanup after missed commits before format xD

This commit is contained in:
Andrew Tomaka 2022-11-02 12:17:19 -04:00
parent ee2869e335
commit 074e0891ac
Signed by: atomaka
GPG key ID: 61209BF70A5B18BE
10 changed files with 235 additions and 481 deletions

View file

@ -1,8 +1,8 @@
#!/bin/bash #!/bin/bash
color_file=$HOME/.config/atomaka/color.yml color_file=$HOME/.config/$USERNAME/color.yml
if ! test -f $color_file; then if ! test -f $color_file; then
mkdir -p $HOME/.config/atomaka mkdir -p $HOME/.config/$USERNAME
echo light > $color_file echo light > $color_file
fi fi
old_color=$(cat $color_file) old_color=$(cat $color_file)

View file

@ -42,6 +42,7 @@ install_alacritty() {
sudo mv /tmp/Alacritty.svg /usr/share/pixmaps/Alacritty.svg sudo mv /tmp/Alacritty.svg /usr/share/pixmaps/Alacritty.svg
sudo desktop-file-install /tmp/Alacritty.desktop sudo desktop-file-install /tmp/Alacritty.desktop
sudo update-desktop-database sudo update-desktop-database
sudo ln -s /home/$USERNAME/.cargo/bin/alacritty /usr/local/bin/alacritty
fi fi
} }
@ -124,7 +125,8 @@ main() {
;; ;;
esac esac
stow alacritty bin git nvim ruby tmux vim zsh stow alacritty bin git nvim ruby tmux zsh
install_alacritty_terminfo
} }
main main

View file

@ -0,0 +1,62 @@
-- PLUGIN CONFIGURATION
--- bufdelete.nvim
vim.keymap.set("n", "<Leader>bd", function()
require("bufdelete").bufdelete(0, true)
end)
--- gitlinker.nvim
require"gitlinker".setup()
vim.keymap.set("n", "<Leader>gh", function()
require"gitlinker".get_buf_range_url(
"n",
{ action_callback = require"gitlinker.actions".open_in_browser }
)
end, { silent = true })
vim.keymap.set("v", "<leader>gh", function()
require"gitlinker".get_buf_range_url(
"v",
{ action_callback = require"gitlinker.actions".open_in_browser }
)
end)
--- gitsigns.nvim
require("gitsigns").setup()
vim.keymap.set("n", "<leader>gb", require("gitsigns").toggle_current_line_blame)
--- NeoZoom.lua
require("neo-zoom").setup({
left_ratio = 0,
top_ratio = 0,
width_ratio = 1,
height_ratio = 1,
border = "none",
})
vim.keymap.set("n", "<C-w>z", require("neo-zoom").neo_zoom)
--- nvim-surround
require("nvim-surround").setup()
--- packer.nvim
vim.keymap.set("n", "<Leader>pi", function()
vim.cmd("PackerCompile")
vim.cmd("PackerInstall")
end)
vim.keymap.set("n", "<Leader>pu", ":PackerSync<CR>")
vim.keymap.set("n", "<Leader>pc", ":PackerClean<CR>")
--- telescope.nvim
vim.keymap.set("n", "<C-p>", function()
require("telescope.builtin").find_files({
file_ignore_patterns = {".git/", "node_modules/"},
hidden = true,
previewer = false,
})
end)
--- whitespace.nvim
require("whitespace-nvim").setup({
hightlight = "red"
})
vim.keymap.set("n", "<Leader>fw", function()
require("whitespace-nvim").trim()
end, { silent = true })

View file

@ -1,274 +1,3 @@
local ensure_packer = function() require "plugins"
local fn = vim.fn require "options"
local install_path = fn.stdpath("data").."/site/pack/packer/start/packer.nvim" require "config"
if fn.empty(fn.glob(install_path)) > 0 then
fn.system({"git", "clone", "--depth", "1", "https://github.com/wbthomason/packer.nvim", install_path})
vim.cmd [[packadd packer.nvim]]
return true
end
return false
end
local packer_bootstrap = ensure_packer()
require("packer").startup(function(use)
local use = use
use "wbthomason/packer.nvim"
-- TODO: autoupdate (but after plugins separate file
-- augroup packer_user_config
-- autocmd!
-- autocmd BufWritePost plugins.lua source <afile> | PackerCompile
-- augroup end
use "nvim-lua/plenary.nvim"
use "nvim-telescope/telescope.nvim"
use "nvim-treesitter/nvim-treesitter"
use "nvim-treesitter/nvim-treesitter-context"
use "famiu/bufdelete.nvim"
use "gpanders/editorconfig.nvim"
use "johnfrankmorgan/whitespace.nvim"
use "kylechui/nvim-surround"
use "L3MON4D3/LuaSnip"
use "lewis6991/gitsigns.nvim"
use "nyngwang/NeoZoom.lua" -- TODO: Floating window background color
use "ruifm/gitlinker.nvim"
use "neovim/nvim-lspconfig"
use "hrsh7th/nvim-cmp"
use "hrsh7th/cmp-nvim-lsp"
use "hrsh7th/cmp-buffer"
use "hrsh7th/cmp-path"
use "hrsh7th/cmp-nvim-lua"
use 'saadparwaiz1/cmp_luasnip'
use "gruvbox-community/gruvbox"
end)
--- SETTING CONFIGURATION
vim.opt.autowrite = true
-- vim.opt.backspace = 2 -- default in neovim?
vim.opt.cpoptions:append("$")
-- vim.opt.endofline -- default in neovim?
-- vim.opt.laststatus = 2 -- default in neovim?
-- vim.opt.backup = false -- default in neovim?
vim.opt.swapfile = false
vim.opt.wrap = false
vim.opt.scrolloff = 3
vim.opt.showmatch = true
-- vim.opt.showmode = true -- default in neovim?
-- vim.opt.showmode = true -- default in neovim?
vim.opt.timeoutlen = 500
vim.opt.virtualedit = "all"
-- vim.opt.hlsearch = true -- default in neovim?
vim.opt.ignorecase = true
-- vim.opt.incsearch = true -- default in neovim?
vim.opt.smartcase = true
-- vim.opt.wrapscan = true -- default in neovim?
vim.opt.number = true
vim.opt.relativenumber = true
vim.opt.textwidth = 80
vim.opt.colorcolumn = {80, 120}
-- Tabs are 2 spaces
vim.opt.tabstop = 2
vim.opt.softtabstop = 2
vim.opt.shiftwidth = 2
vim.opt.expandtab = true
vim.opt.shiftround = true -- make >> go to next tab
-- undo
vim.opt.undolevels = 5000
vim.opt.undofile = true
vim.opt.undodir = os.getenv("HOME") .. "/.config/nvim/undo"
-- REMAP CONFIGURATION
--- Stay in visual mode while tabbing
vim.keymap.set("v", ">", ">gv")
vim.keymap.set("v", "<", "<gv")
--- quick replacement
vim.keymap.set("n", "S", ":%s//g<LEFT><LEFT>")
vim.keymap.set("v", "S", 'y:%s/<C-r><C-r>"//g<Left><Left>')
--- COMMAND CONFIGURATION
--- Avoid typos
vim.api.nvim_create_user_command("W", "w", {})
vim.api.nvim_create_user_command("Wq", "wq", {})
-- CUSTOM CONFIGURATION
--- Targetting!
local reticle = vim.api.nvim_create_augroup("Reticle", {
clear = true
})
vim.api.nvim_create_autocmd({"VimEnter", "WinEnter", "BufWinEnter"}, {
group = reticle,
callback = function()
vim.opt_local.cursorline = true
vim.opt_local.cursorcolumn = true
end
})
vim.api.nvim_create_autocmd({"WinLeave"}, {
group = reticle,
callback = function()
vim.opt_local.cursorline = false
vim.opt_local.cursorcolumn = false
end
})
--- background matching terminal
function ChangeBackground()
local file = io.open(os.getenv("HOME") .. "/.config/atomaka/color.yml", "rb")
local background = file:read()
file:close()
vim.opt.background = background
end
ChangeBackground()
-- LEADER CONFIGURATION
vim.g.mapleader = ","
vim.keymap.set("n", "<leader>sz", ":luafile ~/.config/nvim/init.lua<cr>")
vim.keymap.set({ "n", "v" }, "<leader>cp", '"+y')
vim.keymap.set({ "n", "v" }, "<leader>pa", '"+P')
vim.keymap.set("n", "<leader>cs", ":let @/ = ''<cr>")
vim.keymap.set("n", "<leader>fj", ":%!jq .<cr>")
vim.keymap.set("n", "<leader>gg", ":exe '!gh gist create -w %:p'<cr><cr>")
--- tabs
vim.keymap.set("n", "<Leader>2", function()
print("Setting tabstop to 2")
vim.opt.tabstop = 2
vim.opt.shiftwidth = 2
vim.opt.expandtab = true
end)
vim.keymap.set("n", "<Leader>4", function()
print("Setting tabstop to 4")
vim.opt.tabstop = 4
vim.opt.shiftwidth = 4
vim.opt.expandtab = true
end)
vim.keymap.set("n", "<Leader>a", function()
print("Setting tabstop to tab")
vim.opt.tabstop = 8
vim.opt.shiftwidth = 8
vim.opt.expandtab = false
end)
vim.keymap.set("n", "<Leader>st", ':let @/ = "\t"<cr>')
-- COLOR CONFIGURATION
vim.cmd("colorscheme gruvbox")
vim.api.nvim_create_autocmd({"ColorScheme", "BufWinEnter"}, {
callback = function()
vim.cmd("hi Normal ctermbg=NONE guibg=NONE")
end,
})
-- PLUGIN CONFIGURATION
--- bufdelete.nvim
vim.keymap.set("n", "<Leader>bd", function()
require("bufdelete").bufdelete(0, true)
end)
--- gitlinker.nvim
require"gitlinker".setup()
vim.keymap.set("n", "<Leader>gh", function()
require"gitlinker".get_buf_range_url(
"n",
{ action_callback = require"gitlinker.actions".open_in_browser }
)
end, { silent = true })
vim.keymap.set("v", "<leader>gh", function()
require"gitlinker".get_buf_range_url(
"v",
{ action_callback = require"gitlinker.actions".open_in_browser }
)
end)
--- gitsigns.nvim
require("gitsigns").setup()
vim.keymap.set("n", "<leader>gb", require("gitsigns").toggle_current_line_blame)
--- NeoZoom.lua
require("neo-zoom").setup({
left_ratio = 0,
top_ratio = 0,
width_ratio = 1,
height_ratio = 1,
border = "none",
})
vim.keymap.set("n", "<C-w>z", require("neo-zoom").neo_zoom)
--- nvim-cmp
require("cmp").setup({ -- TODO: More incoming
snippet = {
expand = function(args)
require("luasnip").lsp_expand(args.body)
end,
}
})
--- nvim-lspconfig
require("lspconfig").rust_analyzer.setup({
capabilities = require("cmp_nvim_lsp").update_capabilities(
vim.lsp.protocol.make_client_capabilities()
),
})
--- nvim-surround
require("nvim-surround").setup()
--- nvim-treesitter
require"nvim-treesitter.configs".setup {
ensure_installed = "all",
sync_install = false,
ignore_install = { "phpdoc" }, -- TODO: https://github.com/claytonrcarter/tree-sitter-phpdoc/issues/15
highlight = {
enable = true,
additional_vim_regex_highlighting = false,
},
}
-- nvim-treesitter-context
require("treesitter-context").setup({
patterns = {
rust = {
-- default rust
"impl_item",
"struct",
"enum",
-- substrate xD
"macro_invocation",
},
},
})
--- packer.nvim
vim.keymap.set("n", "<Leader>pi", function()
vim.cmd("PackerCompile")
vim.cmd("PackerInstall")
end)
vim.keymap.set("n", "<Leader>pu", ":PackerSync<CR>")
vim.keymap.set("n", "<Leader>pc", ":PackerClean<CR>")
--- telescope.nvim
vim.keymap.set("n", "<C-p>", function()
require("telescope.builtin").git_files()
end)
--- whitespace.nvim
require("whitespace-nvim").setup({
hightlight = "red"
})
vim.keymap.set("n", "<Leader>fw", function()
require("whitespace-nvim").trim()
end, { silent = true })

View file

@ -0,0 +1,86 @@
-- REMAP CONFIGURATION
--- Stay in visual mode while tabbing
vim.keymap.set("v", ">", ">gv")
vim.keymap.set("v", "<", "<gv")
--- quick replacement
vim.keymap.set("n", "S", ":%s//g<LEFT><LEFT>")
vim.keymap.set("v", "S", 'y:%s/<C-r><C-r>"//g<Left><Left>')
--- COMMAND CONFIGURATION
--- Avoid typos
vim.api.nvim_create_user_command("W", "w", {})
vim.api.nvim_create_user_command("Wq", "wq", {})
-- CUSTOM CONFIGURATION
--- Targetting!
local reticle = vim.api.nvim_create_augroup("Reticle", {
clear = true
})
vim.api.nvim_create_autocmd({"VimEnter", "WinEnter", "BufWinEnter"}, {
group = reticle,
callback = function()
vim.opt_local.cursorline = true
vim.opt_local.cursorcolumn = true
end
})
vim.api.nvim_create_autocmd({"WinLeave"}, {
group = reticle,
callback = function()
vim.opt_local.cursorline = false
vim.opt_local.cursorcolumn = false
end
})
--- background matching terminal
function ChangeBackground()
local home = os.getenv("HOME")
local user = os.getenv("USERNAME")
local file = io.open(home.."/.config/"..user.."/color.yml", "rb")
local background = file:read()
file:close()
vim.opt.background = background
end
ChangeBackground()
-- LEADER CONFIGURATION
vim.g.mapleader = ","
vim.keymap.set("n", "<leader>sz", ":luafile ~/.config/nvim/init.lua<cr>")
vim.keymap.set({ "n", "v" }, "<leader>cp", '"+y')
vim.keymap.set({ "n", "v" }, "<leader>pa", '"+P')
vim.keymap.set("n", "<leader>cs", ":let @/ = ''<cr>")
vim.keymap.set("n", "<leader>fj", ":%!jq .<cr>")
vim.keymap.set("n", "<leader>gg", ":exe '!gh gist create -w %:p'<cr><cr>")
--- tabs
vim.keymap.set("n", "<Leader>2", function()
print("Setting tabstop to 2")
vim.opt.tabstop = 2
vim.opt.shiftwidth = 2
vim.opt.expandtab = true
end)
vim.keymap.set("n", "<Leader>4", function()
print("Setting tabstop to 4")
vim.opt.tabstop = 4
vim.opt.shiftwidth = 4
vim.opt.expandtab = true
end)
vim.keymap.set("n", "<Leader>a", function()
print("Setting tabstop to tab")
vim.opt.tabstop = 8
vim.opt.shiftwidth = 8
vim.opt.expandtab = false
end)
vim.keymap.set("n", "<Leader>st", ':let @/ = "\t"<cr>')
-- COLOR CONFIGURATION
vim.cmd("colorscheme gruvbox")
vim.api.nvim_create_autocmd({"ColorScheme", "BufWinEnter"}, {
callback = function()
vim.cmd("hi Normal ctermbg=NONE guibg=NONE")
end,
})

View file

@ -0,0 +1,38 @@
-- SETTING CONFIGURATION
vim.opt.autowrite = true
-- vim.opt.backspace = 2 -- default in neovim?
vim.opt.cpoptions:append("$")
-- vim.opt.endofline -- default in neovim?
-- vim.opt.laststatus = 2 -- default in neovim?
-- vim.opt.backup = false -- default in neovim?
vim.opt.swapfile = false
vim.opt.wrap = false
vim.opt.scrolloff = 3
vim.opt.showmatch = true
-- vim.opt.showmode = true -- default in neovim?
-- vim.opt.showmode = true -- default in neovim?
vim.opt.timeoutlen = 500
vim.opt.virtualedit = "all"
-- vim.opt.hlsearch = true -- default in neovim?
vim.opt.ignorecase = true
-- vim.opt.incsearch = true -- default in neovim?
vim.opt.smartcase = true
-- vim.opt.wrapscan = true -- default in neovim?
vim.opt.number = true
vim.opt.relativenumber = true
vim.opt.textwidth = 80
vim.opt.colorcolumn = {80, 120}
-- Tabs are 2 spaces
vim.opt.tabstop = 2
vim.opt.softtabstop = 2
vim.opt.shiftwidth = 2
vim.opt.expandtab = true
vim.opt.shiftround = true -- make >> go to next tab
-- undo
vim.opt.undolevels = 5000
vim.opt.undofile = true
vim.opt.undodir = os.getenv("HOME") .. "/.config/nvim/undo"

View file

@ -0,0 +1,40 @@
local ensure_packer = function()
local fn = vim.fn
local install_path = fn.stdpath('data')..'/site/pack/packer/start/packer.nvim'
if fn.empty(fn.glob(install_path)) > 0 then
fn.system({'git', 'clone', '--depth', '1', 'https://github.com/wbthomason/packer.nvim', install_path})
vim.cmd [[packadd packer.nvim]]
return true
end
return false
end
local packer_bootstrap = ensure_packer()
return require('packer').startup(function(use)
local use = use
use "wbthomason/packer.nvim"
-- TODO: autoupdate (but after plugins separate file
-- augroup packer_user_config
-- autocmd!
-- autocmd BufWritePost plugins.lua source <afile> | PackerCompile
-- augroup end
use "nvim-lua/plenary.nvim"
use "nvim-telescope/telescope.nvim"
use "famiu/bufdelete.nvim"
use "gpanders/editorconfig.nvim"
use "johnfrankmorgan/whitespace.nvim"
use "kylechui/nvim-surround"
use "lewis6991/gitsigns.nvim"
use "nyngwang/NeoZoom.lua" -- TODO: Floating window background color
use "ruifm/gitlinker.nvim"
use "gruvbox-community/gruvbox"
if packer_bootstrap then
require('packer').sync()
end
end)

View file

@ -1,6 +1,6 @@
bind-key r source-file ~/.config/tmux/tmux.conf \; display-message " ✱ tmux.conf is reloaded" bind-key r source-file ~/.config/tmux/tmux.conf \; display-message " ✱ tmux.conf is reloaded"
set -g default-terminal "alacritty" set -g default-terminal "xterm-256color"
set -ag terminal-overrides ",alacritty:RGB" set -ag terminal-overrides ",alacritty:RGB"
# for muxception # for muxception

View file

@ -1,203 +0,0 @@
call plug#begin('~/.vim/plugged')
Plug 'chrisbra/matchit'
Plug 'dhruvasagar/vim-zoom'
Plug 'editorconfig/editorconfig-vim'
Plug 'junegunn/fzf'
Plug 'moll/vim-bbye'
Plug 'ntpeters/vim-better-whitespace'
Plug 'tpope/vim-eunuch'
Plug 'tpope/vim-fugitive'
Plug 'tpope/vim-rhubarb'
Plug 'tpope/vim-surround'
" languages
Plug 'fatih/vim-go', { 'do': ':GoUpdateBinaries' }
Plug 'hashivim/vim-terraform'
Plug 'rust-lang/rust.vim'
Plug 'tpope/vim-rails'
Plug 'vim-ruby/vim-ruby'
" colors
Plug 'morhetz/gruvbox'
call plug#end()
" STATUS LINE
set statusline=
set statusline+=%<\ %f%{zoom#statusline()}
set statusline+=\ %m%r%y%w%=
set statusline+=\ Line:\ %l\/%L\ [%p%%]
set statusline+=\ Col:\ %v
set statusline+=\ Buf:\ #%n
set statusline+=\ " trailing space
" SETTINGS
filetype plugin indent on
set autowrite
set backspace=2 " Backspace over indent, eol, start of insert
set cpoptions+=$ " delimit end of change text
set endofline
set laststatus=2 " always show status line
set nobackup
set noswapfile
set nowrap
set scrolloff=3
set showmatch
set showmode
set timeoutlen=500 " Don't wait too long (ambiguous leaders)
set virtualedit=all " Cursor can go anywhere
set hlsearch
set ignorecase
set incsearch
set smartcase
set wrapscan
set number
set relativenumber
set textwidth=80
set colorcolumn=80,120
" For commands
set infercase
set wildcharm=<tab>
set wildignorecase
set wildmenu
set wildmode=list:longest,full
" Tabs are 2 spaces
set tabstop=2
set softtabstop=2
set shiftwidth=2
set expandtab
set shiftround " make >> go to next tab
if has('persistent_undo')
set undolevels=5000
set undofile
if has('nvim')
set undodir=$HOME/.config/nvim/undo
else
set undodir=$HOME/.vim/undo
endif
endif
" consistency is key - Y should act like C, D
map Y y$
" Don't cancel visual mode while indenting
vnoremap > >gv
vnoremap < <gv
" typo-city
command W w
command Wq wq
" quick replaceement
nmap S :%s//g<LEFT><LEFT>
" LEADERS
let mapleader = ","
map <Leader>sz :so ~/.vimrc<cr>
" copy/paste (system buffer)
map <Leader>cp "+y
map <Leader>pa "+p
" tabbing
map <Leader>2 :set tabstop=2 softtabstop=2 shiftwidth=2 expandtab<cr>
map <Leader>4 :set tabstop=4 softtabstop=4 shiftwidth=4 expandtab<cr>
map <Leader>a :set tabstop=8 softtabstop=8 shiftwidth=8 noexpandtab<cr>
map <Leader>st :let @/ = "\t"<cr>
" clear search
map <Leader>cs :let @/ = ""<cr>
" github
map <Leader>gg :exe "!gh gist create -w %:p"<cr><cr>
" filetype overrides
autocmd Filetype rust set colorcolumn=100
autocmd BufNewFile,BufRead *.tftpl :set filetype=terraform
" other
map <Leader>fj :%!jq .<cr>
" COLOR CONFIGURATION
colorscheme gruvbox
" NONE is case sensitive in vim here (but not nvim)
autocmd ColorScheme * hi Normal ctermbg=NONE guibg=NONE
function! ChangeBackground()
let &background=readfile(glob("~/.config/atomaka/color.yml"))[0]
endfunction
call ChangeBackground()
" Targetting!
augroup Reticle
au!
au VimEnter,WinEnter,BufWinEnter * setlocal cursorline
au WinLeave * setlocal nocursorline
au VimEnter,WinEnter,BufWinEnter * setlocal cursorcolumn
au WinLeave * setlocal nocursorcolumn
augroup END
" crosshair
set cursorline
set cursorcolumn
" PLUGIN CONFIGURATION
" editorconfig-vim
let g:EditorConfig_exclude_patterns = ['fugitive://.*', 'scp://.*']
" fzf
let $FZF_DEFAULT_COMMAND = 'ag --hidden --ignore .git -g ""'
noremap <C-p> :FZF<CR>
" rust.vim
let g:rustfmt_autosave = 1
" vim-bbye
nnoremap <silent> <Leader>bd :Bdelete<CR>
" vim-better-whitespace
highlight ExtraWhitespace ctermbg=red
map <Leader>fw :StripWhitespace<cr>
" vim-eunuch
map <Leader>sa :Move %<tab>
" vim-fugitive
autocmd FileType fugitiveblame nmap <buffer> q gq
command! Gblame :G blame
map <Leader>gb :Git blame<cr>
map <Leader>gh :GBrowse<cr>
" vim-plug
map <Leader>pc :PlugClean<cr>
map <Leader>pi :PlugInstall<cr>
map <Leader>pu :PlugUpdate<cr>
" vim-terraform
let g:terraform_align=1
" zoomwintab.vim
nmap <C-w>z <Plug>(zoom-toggle)
nmap <C-w><C-z> <Plug>(zoom-toggle)
let g:zoom#statustext='Z'
function! MyCtrlW()
let char = nr2char(getchar())
if get(t:, 'zoomed', 0) == 1
if char is# 'v' || char is# 's' || char is# '' || char is# ''
return ""
endif
end
return "\<C-w>".char
endfunction
nnoremap <expr> <C-w> MyCtrlW()