Skip to content

Commit 75e7e64

Browse files
committed
misc before reinstall
1 parent e779998 commit 75e7e64

File tree

8 files changed

+106
-51
lines changed

8 files changed

+106
-51
lines changed

.bashrc

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -73,14 +73,6 @@ alias tmux='tmux -2'
7373
export SRC="~/src"
7474
export SEC="mnt/sec/src"
7575

76-
# pyenv
77-
if [ -x "$(command -v pyenv)" ]; then
78-
echo "pyenv found.."
79-
export PATH="$HOME/.pyenv/bin:$PATH"
80-
command -v pyenv >/dev/null || export PATH="$PYENV_ROOT/bin:$PATH"
81-
eval "$(pyenv init -)"
82-
fi
83-
8476
if command -v fzf-share >/dev/null; then
8577
source "$(fzf-share)/key-bindings.bash"
8678
source "$(fzf-share)/completion.bash"

.config/nvim/init.vim

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,5 @@ lua require('binds')
88
lua require('opts.slime')
99
lua require('theme')
1010
lua require('lualine_conf')
11-
lua require('snippets')
11+
lua require('treesitter')
1212
lua require('fzf')

.config/nvim/lua/language.lua

Lines changed: 12 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -80,17 +80,10 @@ lspconfig.lua_ls.setup {
8080
}
8181
}
8282

83-
-- luasnip setup
84-
local luasnip = require 'luasnip'
8583

8684
-- nvim-cmp setup
8785
local cmp = require 'cmp'
8886
cmp.setup {
89-
snippet = {
90-
expand = function(args)
91-
luasnip.lsp_expand(args.body)
92-
end,
93-
},
9487
mapping = cmp.mapping.preset.insert({
9588
['<C-d>'] = cmp.mapping.scroll_docs(-4),
9689
['<C-f>'] = cmp.mapping.scroll_docs(4),
@@ -102,25 +95,20 @@ cmp.setup {
10295
['<Tab>'] = cmp.mapping(function(fallback)
10396
if cmp.visible() then
10497
cmp.select_next_item()
105-
elseif luasnip.expand_or_jumpable() then
106-
luasnip.expand_or_jump()
10798
else
10899
fallback()
109100
end
110101
end, { 'i', 's' }),
111102
['<S-Tab>'] = cmp.mapping(function(fallback)
112103
if cmp.visible() then
113104
cmp.select_prev_item()
114-
elseif luasnip.jumpable(-1) then
115-
luasnip.jump(-1)
116105
else
117106
fallback()
118107
end
119108
end, { 'i', 's' }),
120109
}),
121110
sources = {
122111
{ name = 'nvim_lsp' },
123-
{ name = 'luasnip' },
124112
},
125113
}
126114

@@ -133,17 +121,17 @@ vim.keymap.set('n', ']d', vim.diagnostic.goto_next, opts)
133121
vim.keymap.set('n', '<space>q', vim.diagnostic.setloclist, opts)
134122

135123
-- Filetype detection overrides
136-
require("filetype").setup({
137-
overrides = {
138-
literal = {
139-
["CMakeLists_src.txt"] = "cmake",
140-
["global-config"] = "bitbake",
141-
},
142-
extensions = {
143-
bbappend = "bitbake",
144-
bb = "bitbake",
145-
}
146-
},
147-
})
124+
-- require("filetype").setup({
125+
-- overrides = {
126+
-- literal = {
127+
-- ["CMakeLists_src.txt"] = "cmake",
128+
-- ["global-config"] = "bitbake",
129+
-- },
130+
-- extensions = {
131+
-- bbappend = "bitbake",
132+
-- bb = "bitbake",
133+
-- }
134+
-- },
135+
-- })
148136

149137
require('toggle_lsp_diagnostics').init()

.config/nvim/lua/plugins.lua

Lines changed: 10 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -44,14 +44,7 @@ return require('packer').startup(function(use)
4444
use 'solarnz/thrift.vim' -- thrift syntax
4545
use 'MTDL9/vim-log-highlighting' -- generic log hightighter
4646
use 'kergoth/vim-bitbake' -- syntax for bb files
47-
use 'nathom/filetype.nvim' -- customize filetype detection
48-
-- use {
49-
-- "folke/trouble.nvim",
50-
-- requires = "kyazdani42/nvim-web-devicons",
51-
-- config = function()
52-
-- require("trouble").setup {}
53-
-- end
54-
-- }
47+
-- use 'nathom/filetype.nvim' -- customize filetype detection
5548
use 'LnL7/vim-nix' -- nix language support
5649
use 'psf/black'
5750

@@ -68,9 +61,9 @@ return require('packer').startup(function(use)
6861
use 'tpope/vim-unimpaired'
6962
use 'WhoIsSethDaniel/toggle-lsp-diagnostics.nvim'
7063
use {
71-
'nvim-treesitter/nvim-treesitter',
72-
run = ':TSUpdate'
73-
}
64+
'nvim-treesitter/nvim-treesitter',
65+
run = ':TSUpdate'
66+
}
7467
use { -- complete
7568
'gelguy/wilder.nvim',
7669
config = function()
@@ -83,9 +76,12 @@ return require('packer').startup(function(use)
8376
}
8477

8578
-- THEME
86-
use 'sainnhe/gruvbox-material'
87-
use 'https://gitlab.com/protesilaos/tempus-themes-vim.git'
88-
use 'projekt0n/github-nvim-theme'
79+
use 'sainnhe/gruvbox-material'
80+
use 'https://gitlab.com/protesilaos/tempus-themes-vim.git'
81+
use 'projekt0n/github-nvim-theme'
82+
use 'catppuccin/nvim'
83+
use 'rebelot/kanagawa.nvim'
84+
use 'EdenEast/nightfox.nvim'
8985

9086
-- BOOTSTRAP
9187
if packer_bootstrap then

.config/nvim/lua/theme.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
-- set the color scheme
22
vim.cmd [[ set termguicolors ]]
33
vim.cmd [[ set background=light]]
4-
local ok, _ = pcall(vim.cmd, 'colorscheme gruvbox-material')
4+
local ok, _ = pcall(vim.cmd, 'colorscheme kanagawa-lotus')
55
if not ok then
66
vim.cmd [[ colorscheme default ]]
77
end

.config/nvim/lua/treesitter.lua

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
require 'nvim-treesitter.configs'.setup {
22
-- A list of parser names, or "all" (the four listed parsers should always be installed)
3-
ensure_installed = { "c", "cpp", "lua", "vim", "help", "devicetree", "diff", "bash", "gitcommit", "gitignore",
4-
"javascript", "typescript", "json", "make", "markdown", "tsx", "python" },
3+
ensure_installed = { "c", "cpp", "lua", "vim", "devicetree", "diff", "bash", "gitcommit", "gitignore",
4+
"javascript", "typescript", "json", "make", "markdown", "tsx", "python", "cmake" },
55

66
-- Install parsers synchronously (only applied to `ensure_installed`)
77
sync_install = false,

.tmux.conf

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ set -g @resurrect-strategy-nvim 'session'
3737
set -g @resurrect-capture-pane-contents 'on'
3838

3939
# increase history limit
40-
set -g history-limit 500000
40+
set -g history-limit 5000000
4141

4242
# config tmux-logging plugin
4343
set -g @logging-path "$HOME/Documents/logs/"
@@ -55,6 +55,7 @@ set -g @plugin 'tmux-plugins/tmux-resurrect'
5555
set -g @plugin 'tmux-plugins/tmux-continuum'
5656
set -g @plugin 'tmux-plugins/tmux-pain-control'
5757
set -g @plugin 'tmux-plugins/tmux-fpp'
58+
# set -g @plugin 'tmux-plugins/tmux-yank'
5859
set -g @plugin 'brennanfee/tmux-paste'
5960
set -g @plugin 'tmux-plugins/tmux-logging'
6061
set -g @plugin 'lljbash/tmux-update-display'

script/create-update-json.sh

Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
#!/bin/bash
2+
3+
# Define the file name
4+
file="image.swu"
5+
url=""
6+
json_file="info.json"
7+
forced_update=false
8+
9+
# Parse command line arguments using a loop
10+
while [[ $# -gt 0 ]]; do
11+
case "$1" in
12+
--file=*)
13+
file="${1#*=}"
14+
;;
15+
--url=*)
16+
url="${1#*=}"
17+
;;
18+
--force=*)
19+
forced_update="${1#*=}"
20+
if [[ "$forced_update" != "true" && "$forced_update" != "false" ]]; then
21+
echo "Error: Invalid argument for --force. Please use 'true' or 'false'."
22+
exit 1
23+
fi
24+
;;
25+
--mac=*)
26+
mac="${1#*=}"
27+
;;
28+
*)
29+
echo "Error: Invalid argument: $1"
30+
exit 1
31+
;;
32+
esac
33+
shift
34+
done
35+
36+
# Check if the --url argument is provided and not empty
37+
if [ -z "$url" ]; then
38+
echo "Error: Missing or empty --url argument. Please provide a valid URL."
39+
exit 1
40+
fi
41+
42+
# Use sed to extract the third line of the file
43+
third_line=$(sed -n '3p' "$file")
44+
45+
# Use grep and regular expressions to extract the version variable
46+
if [[ $third_line =~ version\ =\ \"([^\"]+)\" ]]; then
47+
version="${BASH_REMATCH[1]}"
48+
echo "Found version in $file: $version"
49+
else
50+
echo "Error: Unable to extract version from the third line of $file."
51+
exit 1
52+
fi
53+
54+
# Use stat to get the size of the file
55+
file_size=$(stat -c %s "$file")
56+
echo "File size of $file is $file_size bytes."
57+
58+
# If a MAC address is provided, append it to the file name (after extracting the info)
59+
if [ -n "$mac" ]; then
60+
json_file="info.json_mac_$mac"
61+
fi
62+
63+
# Generate the JSON content
64+
json_content=$(cat <<EOF
65+
{
66+
"version": "$version",
67+
"url": "$url",
68+
"imageSize": $file_size,
69+
"forcedUpdate": $forced_update
70+
}
71+
EOF
72+
)
73+
74+
# Write the JSON content to the JSON file
75+
echo "$json_content" > "$json_file"
76+
77+
echo "JSON file '$json_file' created with the following content:"
78+
cat "$json_file"

0 commit comments

Comments
 (0)