This commit is contained in:
Adam Jeniski
2022-07-09 23:38:04 -04:00
parent 60e222eaf8
commit fd8882df39
37 changed files with 3045 additions and 26 deletions
+1 -1
View File
@@ -1,6 +1,6 @@
font:
size: 12
size: 11
#normal:
#family: FiraCode Nerd Font Mono Regular
+3 -2
View File
@@ -158,14 +158,14 @@ bindsym $mod+Shift+8 move container to workspace number $ws8
bindsym $mod+Shift+9 move container to workspace number $ws9
bindsym $mod+Shift+0 move container to workspace number $ws10
bindsym $mod+Tab workspace next
bindsym $mod+Tab workspace back_and_forth
# reload the configuration file
bindsym $mod+Shift+c reload
# restart i3 inplace (preserves your layout/session, can be used to upgrade i3)
bindsym $mod+Shift+r restart
# exit i3 (logs you out of your X session)
bindsym $mod+Shift+e exec "i3-nagbar -t warning -m 'You pressed the exit shortcut. Do you really want to exit i3? This will end your X session.' -B 'Yes, exit i3' 'i3-msg exit'"
bindsym $mod+Shift+q exec "i3-nagbar -t warning -m 'You pressed the exit shortcut. Do you really want to exit i3? This will end your X session.' -B 'Yes, exit i3' 'i3-msg exit'"
# resize window (you can also use the mouse for that)
mode "resize" {
@@ -200,5 +200,6 @@ bar {
status_command i3blocks
font pango:monospace 10
tray_output primary
position top
}
+2 -2
View File
@@ -4,7 +4,7 @@ markup=none
[volume]
label=🔊
command=pactl list sinks | grep -e Volume: | head -n 1 | sed -r 's/.* ([0-9]+%).*/\1/'
command=pactl list sinks | rg -e Volume: | head -n 1 | sed -r 's/.* ([0-9]+%).*/\1/'
color=#A8DFEA
interval=1
@@ -14,7 +14,7 @@ color=#D5A3F7
interval=1
[weather]
command=curl -Ss 'https://wttr.in/?format=%25c%25t%20(%25f)&M'
command=weather_cli | head -n 1
color=#A4C2F4
interval=900
File diff suppressed because it is too large Load Diff
+7 -2
View File
@@ -1,3 +1,8 @@
{
"svelte.ask-to-enable-ts-plugin": false
}
"svelte.ask-to-enable-ts-plugin": false,
"rust-analyzer.procMacro.enable": false,
"zig.enabled": true,
"zig.startUpMessage": true,
"zig.path": "/snap/bin/zig",
"zig.debugLog": false
}
+167
View File
@@ -0,0 +1,167 @@
-- Basics
vim.g.mapleader = " "
vim.opt.incsearch = true
vim.opt.hlsearch = true
vim.opt.ignorecase = true
vim.o.mouse = "a"
vim.o.number = true
vim.o.relativenumber = true
vim.o.wrap = true -- wrap lines
vim.o.encoding = "UTF-8" -- set encoding to UTF-8 (default was "latin1")
vim.o.wildmenu = true -- visual autocomplete for command menu
vim.o.lazyredraw = true -- redraw screen only when we need to
vim.o.showmatch = true -- highlight matching parentheses / brackets [{()}]
vim.o.laststatus = 2 -- always show statusline (even with only single window)
vim.o.ruler = true -- show line and column number of the cursor on right side of statusline
vim.o.visualbell = true -- blink cursor on error, instead of beeping
vim.o.invlist = true -- show tabs
vim.api.nvim_set_keymap("n", "<leader>", "<Plug>(easymotion-bd-jk)", { noremap = true })
vim.keymap.set("i", "kj", "<esc>", { silent = true }) -- sets noremap automatically
vim.api.nvim_set_var("toggle_syntax_state", true)
-- Plugins
local Plug = vim.fn['plug#']
vim.call('plug#begin', '~/.config/nvim/plugged')
Plug 'tpope/vim-sensible'
Plug 'tpope/vim-surround'
Plug('scrooloose/nerdtree', {on = {'NERDTreeToggle', 'NERDTree'}})
Plug 'junegunn/goyo.vim'
Plug('junegunn/fzf', {['do'] = vim.fn['fzf#install']})
Plug('nvim-treesitter/nvim-treesitter', {['do'] = vim.fn['TSUpdate']})
Plug 'ctrlpvim/ctrlp.vim'
Plug 'wadackel/vim-dogrun' -- colorscheme
Plug 'tribela/vim-transparent'
-- LSP
Plug 'neovim/nvim-lspconfig'
Plug 'hrsh7th/cmp-nvim-lsp'
Plug 'hrsh7th/cmp-buffer'
Plug 'hrsh7th/cmp-path'
Plug 'hrsh7th/cmp-cmdline'
Plug 'hrsh7th/nvim-cmp'
Plug 'saadparwaiz1/cmp_luasnip' -- Snippets source for nvim-cmp
Plug 'L3MON4D3/LuaSnip' -- Snippets plugin
-- Airline
Plug 'vim-airline/vim-airline'
Plug 'vim-airline/vim-airline-themes'
-- Lang Support
Plug 'sheerun/vim-polyglot'
Plug 'evanleck/vim-svelte'
Plug 'pantharshit00/vim-prisma'
Plug 'pangloss/vim-javascript'
vim.call('plug#end')
vim.cmd(':colorscheme dogrun')
-- setup Airline
vim.cmd('let g:airline#extensions#tabline#enabled = 1')
vim.cmd("let g:airline#extensions#tabline#left_sep = ' '")
vim.cmd("let g:airline#extensions#tabline#left_alt_sep = '|'")
vim.cmd("let g:airline_theme='night_owl'")
vim.cmd("let g:airline_section_y = '%{strftime(\"%H:%M\")}'")
-- setup TreeSitter
require'nvim-treesitter.configs'.setup {
ensure_installed = "all",
sync_install = false
}
-- luasnip setup
local luasnip = require 'luasnip'
-- setup LSP
local cmp = require'cmp'
cmp.setup({
snippet = {
expand = function(args)
luasnip.lsp_expand(args.body)
end,
},
window = {},
mapping = cmp.mapping.preset.insert({
['<C-b>'] = cmp.mapping.scroll_docs(-4),
['<C-f>'] = cmp.mapping.scroll_docs(4),
['<C-Space>'] = cmp.mapping.complete(),
['<C-e>'] = cmp.mapping.abort(),
['<CR>'] = cmp.mapping.confirm({ select = true }), -- Accept currently selected item. Set `select` to `false` to only confirm explicitly selected items.
}),
sources = cmp.config.sources({
{ name = 'nvim_lsp' },
}, {
{ name = 'buffer' }
})
})
-- Mappings.
-- See `:help vim.diagnostic.*` for documentation on any of the below functions
local opts = { noremap=true, silent=true }
vim.keymap.set('n', '<space>e', vim.diagnostic.open_float, opts)
vim.keymap.set('n', '[d', vim.diagnostic.goto_prev, opts)
vim.keymap.set('n', ']d', vim.diagnostic.goto_next, opts)
vim.keymap.set('n', '<space>q', vim.diagnostic.setloclist, opts)
-- Use an on_attach function to only map the following keys
-- after the language server attaches to the current buffer
local on_attach = function(client, bufnr)
-- Enable completion triggered by <c-x><c-o>
vim.api.nvim_buf_set_option(bufnr, 'omnifunc', 'v:lua.vim.lsp.omnifunc')
-- Mappings.
-- See `:help vim.lsp.*` for documentation on any of the below functions
local bufopts = { noremap=true, silent=true, buffer=bufnr }
vim.keymap.set('n', 'gD', vim.lsp.buf.declaration, bufopts)
vim.keymap.set('n', 'gd', vim.lsp.buf.definition, bufopts)
vim.keymap.set('n', 'K', vim.lsp.buf.hover, bufopts)
vim.keymap.set('n', 'gi', vim.lsp.buf.implementation, bufopts)
vim.keymap.set('n', '<C-k>', vim.lsp.buf.signature_help, bufopts)
vim.keymap.set('n', '<space>wa', vim.lsp.buf.add_workspace_folder, bufopts)
vim.keymap.set('n', '<space>wr', vim.lsp.buf.remove_workspace_folder, bufopts)
vim.keymap.set('n', '<space>wl', function()
print(vim.inspect(vim.lsp.buf.list_workspace_folders()))
end, bufopts)
vim.keymap.set('n', '<space>D', vim.lsp.buf.type_definition, bufopts)
vim.keymap.set('n', '<space>rn', vim.lsp.buf.rename, bufopts)
vim.keymap.set('n', '<space>ca', vim.lsp.buf.code_action, bufopts)
vim.keymap.set('n', 'gr', vim.lsp.buf.references, bufopts)
vim.keymap.set('n', '<space>f', vim.lsp.buf.formatting, bufopts)
end
vim.api.nvim_create_autocmd(
{ "BufEnter" },
{ pattern = { "*" }, command = "if tabpagenr('$') == 1 && winnr('$') == 1 && exists('b:NERDTree') && b:NERDTree.isTabTree() | quit | endif" }
)
local lsp_flags = {
}
require('lspconfig')['tsserver'].setup{
on_attach = on_attach,
flags = lsp_flags,
}
require('lspconfig')['rust_analyzer'].setup{
on_attach = on_attach,
flags = lsp_flags,
-- Server-specific settings...
settings = {
["rust-analyzer"] = {}
}
}
require('lspconfig')['svelte'].setup{
on_attach = on_attach,
flags = lsp_flags
}
vim.cmd("let g:ctrlp_custom_ignore = 'node_modules\\|DS_Store\\|git\\|build\\|dist\\|target'")
-- keymaps
vim.keymap.set("n", "<c-s>", ":wa<cr>")
vim.keymap.set("n", "<c-t>", ":NERDTreeToggle<cr>")
vim.keymap.set("n", "<leader>tt", ":TransparentToggle<cr>")
vim.keymap.set("n", "gt", ":bn<cr>")
vim.keymap.set("n", "gT", ":bp<cr>")
vim.keymap.set("n", "<cr>", ":nohlsearch<cr><cr>")
Submodule .config/nvim/plugged/LuaSnip added at 7d78278c2a
Submodule .config/nvim/plugged/cmp-buffer added at 62fc67a2b0
Submodule .config/nvim/plugged/cmp-cmdline added at c36ca4bc1d
Submodule .config/nvim/plugged/cmp-nvim-lsp added at affe808a5c
Submodule .config/nvim/plugged/cmp-path added at 981baf9525
Submodule .config/nvim/plugged/cmp_luasnip added at a9de941bcb
Submodule .config/nvim/plugged/ctrlp.vim added at 3ce448c968
Submodule .config/nvim/plugged/fzf added at 51fdaad002
Submodule .config/nvim/plugged/goyo.vim added at a9c7283dce
Submodule .config/nvim/plugged/nerdtree added at fc85a6f07c
Submodule .config/nvim/plugged/nvim-cmp added at 9897465a76
Submodule .config/nvim/plugged/nvim-lspconfig added at 06161eca0a
Submodule .config/nvim/plugged/nvim-treesitter added at 0fc45ea650
Submodule .config/nvim/plugged/vim added at d7723a842a
Submodule .config/nvim/plugged/vim-airline added at 91b67e3ca2
Submodule .config/nvim/plugged/vim-airline-themes added at 97cf3e6e63
Submodule .config/nvim/plugged/vim-dogrun added at f1a6ec680d
Submodule .config/nvim/plugged/vim-javascript added at d6e137563c
Submodule .config/nvim/plugged/vim-polyglot added at 38282d5838
Submodule .config/nvim/plugged/vim-prisma added at e91ac50112
Submodule .config/nvim/plugged/vim-sensible added at 226203be17
Submodule .config/nvim/plugged/vim-surround added at bf3480dc9a
Submodule .config/nvim/plugged/vim-svelte added at 1080030d6a
Submodule .config/nvim/plugged/vim-transparent added at e2f16c1e33
Submodule .config/nvim/plugged/yats.vim added at 68cd1da2bc
+6
View File
@@ -19,6 +19,12 @@ bind -n M-j select-pane -D
bind -n M-k select-pane -U
bind -n M-l select-pane -R
bind -n M-H resize-pane -L 5
bind -n M-J resize-pane -D 5
bind -n M-K resize-pane -U 5
bind -n M-L resize-pane -R 5
set -s escape-time 0
#add vim binds with prefix
+4 -3
View File
@@ -1,8 +1,9 @@
#!/bin/bash
pactl list | \
grep -e media.name | \
grep -v -e recStream -e playStream -e Playback | \
rg -e media.name | \
rg -v -e recStream -e playStream -e Playback -e playback | \
tail -n 1 | \
sed -r 's/.*"(.*)".*/\1/'
sed -r 's/^.*= "(.*)"$/\1/' | \
sed 's/\\"/"/g'
+5
View File
@@ -0,0 +1,5 @@
#!/bin/bash
PORT=$1
kill -9 $(lsof -t -i:$PORT)
+9
View File
@@ -0,0 +1,9 @@
#!/bin/bash
if [[ -f ~/Pictures/screenshot.png ]]; then
rm ~/Pictures/screenshot.png
fi
scrot ~/Pictures/screenshot.png
convert ~/Pictures/screenshot.png -crop 1920x1080+0+0 ~/Pictures/screenshot.png
+4 -16
View File
@@ -11,7 +11,8 @@ let mapleader = ' '
let maplocalleader = ' '
" save file bind
noremap <c-s> :w<cr>
nnoremap <c-s> :w<cr>
inoremap <c-s> <esc>:w<cr>
" exit terminal mode
:tnoremap <Esc> <C-\><C-n>
@@ -110,26 +111,13 @@ if has('nvim')
EOF
endif
function! s:check_back_space() abort
let col = col('.') - 1
return !col || getline('.')[col - 1] =~ '\s'
endfunction
function! CheckBackspace() abort
let col = col('.') - 1
return !col || getline('.')[col - 1] =~# '\s'
endfunction
inoremap <silent><expr> <TAB>
\ pumvisible() ? "\<C-n>" :
\ CheckBackspace() ? "\<TAB>" :
\ coc#refresh()
inoremap <expr><S-TAB> pumvisible() ? "\<C-p>" : "\<C-h>"
" Make <CR> auto-select the first completion item and notify coc.nvim to
" " format on enter, <cr> could be remapped by other vim plugin
inoremap <silent><expr> <cr> pumvisible() ? coc#_select_confirm()
\: "\<C-g>u\<CR>\<c-r>=coc#on_enter()\<CR>"
inoremap <silent><expr> <tab> pumvisible() ? coc#_select_confirm()
\: "\<C-g>u\<CR>\<c-r>=coc#on_enter()\<CR>"
" Use <c-space> to trigger completion.
if has('nvim')