dotfiles bugabingas dorkfiles
owned by bugabinga
README Source History Refs Compare Notes Search Merge branch 'trunk' of github.com:bugabinga/dotfiles into trunk
b5f528ea62e411dbeff33edd966a32bed0744181
Oliver Jan Krylow <olver@bugabinga.net > · 18 Aug 2021
unsigned
Browse files Compare with HEAD
Changed files (15) EJ-PC-00363.symlinks Modified 7 7 git/gitconfig.EJ-PC-00363
10 - starship/starship.toml
10 + starship/starship.toml.EJ-PC-00363
11 11 ~/.config/starship.toml
13 13 alacritty/alacritty.windows.yml
36 36 - [ ] rewrite bootstripper and java commmands with zig. how to run them? precompile? zig run?
37 37 - [ ] encrypt box key
38 38 - [ ] get SIM card to work on x230
39 + - [ ] disable syntax highlighting (treesitter) for inactive buffers and dim color
40 + - [ ] port commands from vim-eunuch:
44 + - [ ] LSP diagnostics only on BufWrite
45 + - [ ] easier too read colors for lsp hovers
bootstripper.java Modified 11 11 var dorkfiles_root
= Path .of(arguments[
0 ]).toRealPath();
12 12 System .out.printf(
"Assuming dorkfiles root repo in %s.%n" , emphasize_local(dorkfiles_root.toString()));
13 - decrypt_secrets(dorkfiles_root.resolve(
"secrets" ));
13 + decrypt_secrets(dorkfiles_root.resolve(
"tresor" ));
14 14 var hostname
= hostname();
15 15 System .out.printf(
"Hostname: %s%n" , emphasize_global(hostname));
16 16 var symlinks_file
= hostname
+ ".symlinks" ;
17 - create_symlinks(dorkfiles_root.resolve(symlinks_file));
17 + create_symlinks(dorkfiles_root, dorkfiles_root.resolve(symlinks_file));
19 19 static void decrypt_secrets(
Path secrets_root) throws
Exception {
20 20 System .out.printf(
"%s:Decrypting files in %s folder.%n" , emphasize_global(
"TODO" ), emphasize_local(secrets_root.getFileName().toString()));
22 - static void create_symlinks(
Path symlinks_file) throws
Exception {
22 + static void create_symlinks(
Path root,
Path symlinks_file) throws
Exception {
23 23 System .out.printf(
"Creating symlinks as defined in %s file.%n" , emphasize_local(symlinks_file.getFileName().toString()));
24 24 var lines
= Files .readAllLines(symlinks_file);
25 25 String source
= null ;
29 29 if (source
== null ) source
= line;
30 30 else if (target
== null ) target
= line;
31 31 if (source
!= null && target
!= null ){
32 - link(source, target);
32 + link(root, source, target);
38 - static void link(
String source,
String target) throws
Exception {
38 + static void link(
Path root,
String source,
String target) throws
Exception {
39 39 var home
= System .getProperty(
"user.home" );
40 - var source_path
= Path .of(source.replace(
"~" , home)).toAbsolutePath();
40 + var source_path
= root.resolve(source).toAbsolutePath();
41 41 var target_path
= Path .of(target.replace(
"~" , home)).toAbsolutePath();
42 42 var is_directory
= Files .isDirectory(source_path);
43 43 if (
Files .exists(target_path,
LinkOption .
NOFOLLOW_LINKS )){
49 - System .out.printf(
"❌ %s exists, but it points into nirvana. Removing broken link!%n" , target_path.toString());
49 + System .out.printf(
"%n❌ %s exists, but it points into nirvana. Removing broken link!%n" , target_path.toString());
50 50 Files .delete(target_path);
87 87 static String hostname() throws
Exception {
88 - var process
= new ProcessBuilder ()
89 - .command(
"hostname" )
88 + var process_builder
= new ProcessBuilder ();
89 + var operating_system
= System .getProperty(
"os.name" );
90 + if (operating_system.toLowerCase().contains(
"linux" )){
91 + process_builder
= process_builder.command(
"hostnamectl" ,
"hostname" );
95 + process_builder
= process_builder.command(
"hostname" );
97 + var process
= process_builder
93 101 try (
var reader
= new InputStreamReader (process.getInputStream()))
95 103 int character
= - 1 ;
neovim/lua/autocommand.lua Modified 4 - return function (groups)
5 - for name, commands
in pairs (groups)
do 4 + return function (autocmd_groups)
5 + for name, commands
in pairs (autocmd_groups)
do 7 7 vim.cmd(
'augroup ' .. name)
neovim/lua/general_editor_settings.lua Modified 66 66 vim.opt.showcmd
= false 67 67 vim.opt.wildmode
= "list:longest" 69 - vim.opt.autochdir
= false 69 + vim.opt.autochdir
= true 71 71 vim.opt.autoread
= true neovim/lua/lsp.lua Modified 8 8 local integrate_into_neovim = function (client, buffer_number)
9 9 print (
"LSP " .. client.name
.. " [" .. client.id
.. "] " .. "started." )
10 - local chain_complete_list
= {
12 - {
complete_items = {
"lsp" ,
"snippet" } },
13 - {
complete_items = {
"path" },
triggered_only = {
"/" } },
14 - {
complete_items = {
"buffers" } },
17 - {
complete_items = {
"path" },
triggered_only = {
"/" } },
22 - require (
"completion" ).on_attach({
24 - enable_auto_popup =
false ,
25 - chain_complete_list = chain_complete_list,
13 + require (
"completion" ).on_attach()
15 + require "lspkind" .init()
29 18 vim.api.nvim_buf_set_option(buffer_number,
"omnifunc" ,
"v:lua.vim.lsp.omnifunc" )
32 21 map(
"n" ,
"<LEADER>gD" ,
"<CMD>lua vim.lsp.buf.declaration()<CR>" )
33 22 map(
"n" ,
"<LEADER>gd" ,
"<CMD>lua vim.lsp.buf.definition()<CR>" )
34 - map(
"n" ,
"<LEADER>K" ,
"<CMD>lua vim.lsp.buf.hover()<CR>" )
35 23 map(
"n" ,
"<LEADER>gr" ,
"<CMD>lua vim.lsp.buf.references()<CR>" )
36 - map(
"n" ,
"<LEADER>gs" ,
"<CMD>lua vim.lsp.buf.signature_help()<CR>" )
37 24 map(
"n" ,
"<LEADER>gi" ,
"<CMD>lua vim.lsp.buf.implementation()<CR>" )
38 25 map(
"n" ,
"<LEADER>gt" ,
"<CMD>lua vim.lsp.buf.type_definition()<CR>" )
39 26 map(
"n" ,
"<LEADER>gw" ,
"<CMD>lua vim.lsp.buf.document_symbol()<CR>" )
40 27 map(
"n" ,
"<LEADER>gW" ,
"<CMD>lua vim.lsp.buf.workspace_symbol()<CR>" )
41 29 map(
"n" ,
"<LEADER>ah" ,
"<CMD>lua vim.lsp.buf.hover()<CR>" )
30 + map(
"n" ,
"<LEADER>as" ,
"<CMD>lua vim.lsp.buf.signature_help()<CR>" )
42 31 map(
"n" ,
"<LEADER>af" ,
"<CMD>lua vim.lsp.buf.code_action()<CR>" )
43 32 map(
"n" ,
"<LEADER>ar" ,
"<CMD>lua vim.lsp.buf.rename()<CR>" )
44 - map(
"n" ,
"<LEADER>=" ,
"<CMD>lua vim.lsp.buf.formatting()<CR>" )
33 + map(
"n" ,
"<LEADER>a=" ,
"<CMD>lua vim.lsp.buf.formatting()<CR>" )
45 34 map(
"n" ,
"<LEADER>ai" ,
"<CMD>lua vim.lsp.buf.incoming_calls()<CR>" )
46 35 map(
"n" ,
"<LEADER>ao" ,
"<CMD>lua vim.lsp.buf.outgoing_calls()<CR>" )
121 111 lsp.zeta_note.setup({
122 112 on_attach = integrate_into_neovim,
neovim/lua/plugins.lua Modified 15 15 local packer_installation_path
= data_path
.. "/site/pack/" .. plugin_package
.. "/opt/packer.nvim" 16 16 if vim.fn.empty(vim.fn.glob(packer_installation_path))
== 1 then 17 17 vim.cmd(
'!git clone https://github.com/wbthomason/packer.nvim "' .. packer_installation_path
.. '"' )
18 + vim.cmd(
"packadd packer" )
20 21 local init = function ()
101 97 "tjdevries/colorbuddy.vim" ,
102 98 config =
function ()
109 105 "nvim-treesitter/nvim-treesitter" ,
106 + requires = {
"nvim-treesitter/nvim-treesitter-refactor" },
110 107 config =
function ()
111 108 require (
"nvim-treesitter.install" ).compilers
= {
"clang" }
112 109 require (
"nvim-treesitter.configs" ).setup({
113 - ensure_installed = {
"zig" ,
"java" ,
"rust" ,
"lua" ,
"toml" ,
"yaml" ,
"json" ,
"c" },
110 + ensure_installed = {
114 127 highlight = {
enable =
true },
115 128 incremental_selection = {
124 137 indent
= {
enable =
true },
125 138 query_linter
= {
enable =
true ,
use_virtual_text =
true ,
lint_events = {
"BufWrite" } },
140 + highlight_definitions = {
enable =
true },
141 + smart_rename = {
enable =
true ,
keymaps = {
smart_rename =
"<LEADER>r" } },
144 + keymaps = {
goto_next_usage =
"<a-.>" ,
goto_previous_usage =
"<a-,>" },
209 + vim.lsp.handlers[
"textDocument/codeAction" ]
= require (
"lsputil.codeAction" ).code_action_handler
210 + vim.lsp.handlers[
"textDocument/references" ]
= require (
"lsputil.locations" ).references_handler
211 + vim.lsp.handlers[
"textDocument/definition" ]
= require (
"lsputil.locations" ).definition_handler
212 + vim.lsp.handlers[
"textDocument/declaration" ]
= require (
"lsputil.locations" ).declaration_handler
213 + vim.lsp.handlers[
"textDocument/typeDefinition" ]
= require (
"lsputil.locations" ).typeDefinition_handler
214 + vim.lsp.handlers[
"textDocument/implementation" ]
= require (
"lsputil.locations" ).implementation_handler
215 + vim.lsp.handlers[
"textDocument/documentSymbol" ]
= require (
"lsputil.symbols" ).document_handler
216 + vim.lsp.handlers[
"workspace/symbol" ]
= require (
"lsputil.symbols" ).workspace_handler
192 222 "neovim/nvim-lspconfig" ,
194 224 "nvim-lua/completion-nvim" ,
226 + "onsails/lspkind-nvim" ,
228 + "RishabhRD/popfix" ,
231 + "RishabhRD/nvim-lsputils" ,
231 268 command
= "VBox" ,
273 + use(
"Iron-E/nvim-cartographer" )
276 + use(
"beauwilliams/focus.nvim" )
neovim/lua/statusline.lua Modified 1 1 local branch_icon
= "" 2 2 local vcs_branch_name
= "" 3 + local code_actions_count
= 0 3 4 local special_windows
= {
4 5 intro = {
"CheatSheet" ,
"" },
5 6 NvimTree = {
"Files" ,
"" },
6 7 packer = {
"Plugins" ,
"" },
7 8 help = {
"Help" ,
"龎" },
9 + [
"" ] = {
"unknown file type" ,
"" },
9 11 local lsp_symbols
= {
Error =
"" ,
Information =
"" ,
Warning =
"" ,
Hint =
"" }
25 + update_code_actions_count =
function ()
26 + local diagnostics_line_context
= {
diagnostics = vim.lsp.diagnostic.get_line_diagnostics() }
27 + local lsp_parameters
= vim.lsp.util.make_range_params()
28 + lsp_parameters.context
= diagnostics_line_context
29 + vim.lsp.buf_request(
0 ,
"textDocument/codeAction" , lsp_parameters,
function (error, _, result)
30 + if not error and result
then 31 + code_actions_count
= # result
33 + code_actions_count
= 0 25 39 update_statuslines =
function ()
26 40 for _, window_number
in pairs (vim.api.nvim_list_wins())
do 27 41 if vim.api.nvim_get_current_win()
== window_number
then 28 - vim.opt.statusline
= [[%!v:lua.require'statusline'.render("current")]] 29 - elseif vim.api.nvim_buf_get_name(
0 )
~= "" then 30 - vim.opt.statusline
= [[%!v:lua.require'statusline'.render()]] 42 + vim.wo[window_number].statusline
= [[%!v:lua.require'statusline'.render("current")]] 44 + vim.wo[window_number].statusline
= [[%!v:lua.require'statusline'.render()]] 35 49 update_vcs_branch_name =
function ()
36 50 if not pcall (
require ,
"plenary" )
then 53 + local Job
= require (
"plenary.job" )
54 + local git
= Job:new({
56 + args = {
"branch" ,
"--show-current" },
57 + cwd = vim.fn.expand(
"%:p:h" ),
58 + on_exit =
function (output)
59 + local result
= output:result()[
1 ]
61 + vcs_branch_name
= result
65 + local svn
= Job:new({
68 + cwd = vim.fn.expand(
"%:p:h" ),
69 + on_exit =
function (output)
70 + local result
= output:result()[
4 ]
71 + result
= result
and result:match(
"Relative URL:%s%^/([%w/]+).*" )
or nil 73 + vcs_branch_name
= result
78 + local all
= { git, svn }
79 + for _, tool
in pairs (all)
do 39 - require (
"plenary.job" )
42 - args = {
"branch" ,
"--show-current" },
43 - cwd = vim.fn.expand(
"%:p:h" ),
44 - on_exit =
function (output)
45 - local result
= output:result()[
1 ]
47 - vcs_branch_name
= "%#LineNr#%=" .. branch_icon
.. " " .. result
49 - vcs_branch_name
= "" 56 84 render =
function (active)
57 85 local filetype
= vim.bo.filetype
58 86 local special_window
= special_windows[filetype]
59 - if active
and special_window
then 60 - return "%#LineNr#%=" .. special_window[
2 ]
.. " " .. special_window[
1 ]
.. "%=" 87 + if special_window
then 88 + return "%#Statusline" 89 + .. (active
and "" or "NC" )
91 + .. special_window[
2 ]
93 + .. special_window[
1 ]
62 - local edited
= vim.bo.mod
and "" or "" 63 - local modifiable
= vim.bo.modifiable
and "" or "" 96 + local edited
= vim.bo.mod
and "" or " " 97 + local modifiable
= vim.bo.modifiable
and " " or "" 64 98 local diagnostics
= get_lsp_diagnostics_count()
100 + local vcs_info
= vcs_branch_name
and (
"%#LineNr#%=" .. branch_icon
.. " " .. vcs_branch_name)
or nil 66 102 local statusline
= "%#Statusline" 67 103 .. (active
and "" or "NC" )
74 - .. (diagnostics
~= "" and " " .. diagnostics
.. " " or " " )
75 - .. (active
and vcs_branch_name
or "" )
110 + .. (active
and (diagnostics
~= "" and " " .. diagnostics
.. " " or " " )
or " " )
111 + .. (code_actions_count
~= 0 and (
"%#Title#" .. " " .. code_actions_count
.. " ﯦ" )
or "" )
112 + .. (active
and vcs_info
or "" )
80 117 setup = function (autocommand)
82 - update_statusline =
"CursorHold,CursorHoldI * lua require'statusline'.update_statuslines()" ,
83 - update_vcs_branch_name =
"BufEnter,BufWinEnter,WinEnter,BufReadPost * lua require'statusline'.update_vcs_branch_name()" ,
120 + update_vcs_branch_name =
"BufEnter,WinEnter,BufWinEnter,BufReadPost * lua require'statusline'.update_vcs_branch_name()" ,
121 + update_code_actions_count =
"CursorHold,CursorHoldI * lua require'statusline'.update_code_actions_count()" ,
122 + update_statuslines =
"CursorHold,CursorHoldI,BufEnter,WinEnter,BufWinEnter,BufReadPost * lua require'statusline'.update_statuslines()" ,
neovim/lua/tabline.lua Modified 17 17 render = function ()
18 18 local buffer_names_to_ignore
= {
'NvimTree' }
21 - for _, buffer_number
in pairs (vim.api.nvim_list_bufs())
do 22 - if vim.api.nvim_buf_is_valid(buffer_number)
and vim.api.nvim_buf_is_loaded(buffer_number)
then 20 + for _, current_tab
in pairs (vim.api.nvim_list_tabpages())
do 21 + if vim.api.nvim_tabpage_is_valid(current_tab)
then 22 + local current_window
= vim.api.nvim_tabpage_get_win(current_tab)
23 + if not vim.api.nvim_win_is_valid(current_window)
then goto continue
end 24 + local current_buffer
= vim.api.nvim_win_get_buf(current_window)
25 + if not (vim.api.nvim_buf_is_valid(current_buffer)
and vim.api.nvim_buf_is_loaded(current_buffer))
then goto continue
end 23 26 local modified
= vim.bo.modified
and "" or " " 25 - local stylish_buffer_name
= vim.api.nvim_buf_get_name(buffer_number):match(
".-([^\\/]-)$" )
or "" 26 - if vim.tbl_contains(buffer_names_to_ignore, stylish_buffer_name)
or stylish_buffer_name
== "" then goto continue
end 28 + local current_buffer_name
= vim.api.nvim_buf_get_name(current_buffer)
29 + local stylish_buffer_name
= current_buffer_name:match(
".-([^\\/]-)$" )
or "" 30 + if vim.tbl_contains(buffer_names_to_ignore, stylish_buffer_name)
then goto continue
end 32 - if stylish_buffer_name
== "cheatsheet" then 32 + if stylish_buffer_name
== "" then 33 + stylish_buffer_name
= "no name" 35 + elseif stylish_buffer_name
== "cheatsheet" then 35 38 local extension
= stylish_buffer_name:match(
"%w+%.(.+)" )
36 39 icon
= get_icon(stylish_buffer_name, extension)
38 41 stylish_buffer_name
= " " .. stylish_buffer_name
.. " " 39 - local is_current_buffer
= vim.api.nvim_get_current_buf()
== buffer_number
42 + local is_current_buffer
= vim.api.nvim_get_current_buf()
== current_buffer
40 43 tabline
= tabline
.. "%#TabLine" .. 41 44 (is_current_buffer
and "Sel" or "" )
.. "#" .. 42 45 " " .. icon
.. stylish_buffer_name
.. (is_current_buffer
and modified
or " " )
31 - starship/starship.toml
31 + starship/starship.toml.pop-os
32 32 ~/.config/starship.toml
37 34 topgrade/topgrade.linux.toml
38 35 ~/.config/topgrade.toml
starship/starship.toml Deleted deleted file mode 100644 2 - success_symbol =
' (dimmed green)' 4 - error_symbol =
' (dimmed red)' 8 - truncation_symbol =
'⋯ /' 10 - truncation_length =
5 13 - style =
'yellow dimmed' 20 - style =
"dimmed cyan" 23 - style =
"dimmed cyan" 26 - style =
"dimmed yellow" 30 - format =
"$symbol $ram_pct ($style)" 33 - style =
"dimmed gray" starship/starship.toml.EJ-PC-00363 Added new file mode 100644 3 + success_symbol = ' (dimmed green)'
4 + # does not work yet in nushell
5 + error_symbol = ' (dimmed red)'
9 + truncation_symbol = '⋯ /'
11 + truncation_length = 5
15 + style = 'dimmed yellow'
26 + style = "dimmed cyan"
30 + style = "dimmed cyan"
33 + style = "dimmed yellow"
36 + style = "dimmed blue"
41 + format = "$symbol $ram_pct ($style)"
44 + style = "dimmed gray"
starship/starship.toml.pop-os Added new file mode 100644 3 + success_symbol = ' (dimmed green)'
4 + # does not work yet in nushell
5 + error_symbol = ' (dimmed red)'
9 + truncation_symbol = '⋯ /'
11 + truncation_length = 5
15 + style = 'dimmed yellow'
26 + style = "dimmed cyan"
30 + style = "dimmed cyan"
33 + style = "dimmed yellow"
36 + style = "dimmed blue"
41 + format = "$symbol $ram_pct ($style)"
44 + style = "dimmed gray"
starship/starship.toml.x230 Added new file mode 100644 3 + success_symbol = ' (dimmed green)'
4 + # does not work yet in nushell
5 + error_symbol = ' (dimmed red)'
9 + truncation_symbol = '⋯ /'
11 + truncation_length = 5
15 + style = 'dimmed yellow'
26 + style = "dimmed cyan"
30 + style = "dimmed cyan"
33 + style = "dimmed yellow"
36 + style = "dimmed blue"
41 + format = "$symbol $ram_pct ($style)"
44 + style = "dimmed gray"
48 + charging_symbol = "⚡️ "
49 + discharging_symbol = "💀 "
8 + ~/.config/git/.gitconfig.include
10 + alacritty/alacritty.linux.yml
11 + ~/.config/alacritty/alacritty.yml
13 + alacritty/alacritty_common.yml
14 + ~/.config/alacritty/alacritty_common.yml
16 + alacritty/Alacritty.desktop
17 + ~/.local/share/applications/Alacritty.desktop
19 + alacritty/alacritty-simple.svg
20 + ~/.local/share/icons/hicolor/scalable/apps/Alacritty.svg
28 + starship/starship.toml.x230
29 + ~/.config/starship.toml
1 31 icc/thinkpad_x230.icc
2 32 ~/.config/icc/thinkpad_x230.icc
4 34 indexa/config.linux.toml
5 35 ~/.config/indexa/config.toml
37 + topgrade/topgrade.linux.toml
38 + ~/.config/topgrade.toml