summaryrefslogtreecommitdiffstats
path: root/.config
diff options
context:
space:
mode:
Diffstat (limited to '.config')
-rw-r--r--.config/env2
-rw-r--r--.config/mimeapps.list1
-rwxr-xr-x.config/nnn/plugins/joe_clipper7
-rwxr-xr-x.config/nnn/plugins/joe_dragdrop47
-rw-r--r--.config/nvim/lua/config/hooks.lua9
-rw-r--r--.config/nvim/lua/lsp/arduino.lua3
6 files changed, 65 insertions, 4 deletions
diff --git a/.config/env b/.config/env
index aafc3fc..83b78ac 100644
--- a/.config/env
+++ b/.config/env
@@ -110,7 +110,7 @@ export NNN_BATSTYLE='plain'
export NNN_PREVIEWIMGPROG='icat'
export NNN_PREVIEWVIDEO='tct'
export NNN_ICONLOOKUP=0
-export NNN_PLUG='t:joe_fzfcd;p:-preview-tui;s:-!gdu -s;f:-fzopen;c:-joe_clipper'
+export NNN_PLUG='t:joe_fzfcd;p:-preview-tui;s:-!gdu -s;f:-fzopen;c:-joe_clipper;d:-joe_dragdrop'
export RUSTFLAGS='-L /usr/local/lib'
export WWW_HOME='https://start.duckduckgo.com/'
export YTFZF_HIST='0'
diff --git a/.config/mimeapps.list b/.config/mimeapps.list
index 8f2eaa4..63e0cbf 100644
--- a/.config/mimeapps.list
+++ b/.config/mimeapps.list
@@ -40,6 +40,7 @@ text/x-java=nvim.desktop
text/x-makefile=nvim.desktop
text/x-readme=nvim.desktop
text/x-tcl=nvim.desktop
+text/x-perl=bat-joe.desktop
x-scheme-handler/msteams=teams.desktop
video/mp4=mpv.desktop
application/zip=xarchiver.desktop
diff --git a/.config/nnn/plugins/joe_clipper b/.config/nnn/plugins/joe_clipper
index 8c0fa5d..54d8095 100755
--- a/.config/nnn/plugins/joe_clipper
+++ b/.config/nnn/plugins/joe_clipper
@@ -1,9 +1,12 @@
#!/usr/bin/env perl
+
use strict;
use warnings;
use Cwd qw(cwd);
+use constant XCLIP => 'xclip -selection clipboard ';
+
sub close_io
{
open STDIN, '<', '/dev/null' or die $!;
@@ -19,7 +22,7 @@ sub clip_img
$pid = fork();
if ($pid == 0) {
- system("magick $file png:- | xclip -selection clipboard -t image/png");
+ system("magick '$file' png:- | " . XCLIP . "-t image/png");
exec(
'notify-send',
'-t', '2000',
@@ -38,7 +41,7 @@ sub clip_raw
$pid = fork();
if ($pid == 0) {
- system( "xclip -selection clipboard $file");
+ system( "xclip -selection clipboard '$file'");
exec(
'notify-send',
'-t', '2000',
diff --git a/.config/nnn/plugins/joe_dragdrop b/.config/nnn/plugins/joe_dragdrop
new file mode 100755
index 0000000..2623c47
--- /dev/null
+++ b/.config/nnn/plugins/joe_dragdrop
@@ -0,0 +1,47 @@
+#!/usr/bin/env sh
+
+# Description: Open a Drag and drop window, to drop files onto other programs.
+# Also provides drag and drop window for files.
+#
+# Dependencies: dragon - https://github.com/mwh/dragon
+#
+# Notes:
+# 1. Files that are dropped will be added to nnn's selection
+# Some web-based files will be downloaded to current dir
+# with curl and it may overwrite some existing files
+# 2. The user has to mm to clear nnn's selection first
+#
+# Shell: POSIX compliant
+# Author: 0xACE
+
+selection=${NNN_SEL:-${XDG_CONFIG_HOME:-$HOME/.config}/nnn/.selection}
+resp=f
+all=
+if type dragon-drag-and-drop >/dev/null 2>&1; then
+ dnd="dragon-drag-and-drop"
+elif type dragon-drop >/dev/null 2>&1; then
+ dnd="dragon-drop"
+else
+ dnd="dragon"
+fi
+
+add_file ()
+{
+ printf '%s\0' "$@" >> "$selection"
+}
+
+if [ -s "$selection" ]; then
+ printf "Drag selection (s) or drag current file (f) [default=f]: "
+ read -r resp
+else
+ resp=f
+fi
+
+if [ "$resp" = "s" ]; then
+ all="--all"
+ sed -z 's|'"$PWD/"'||g' < "$selection" | xargs -0 "$dnd" --and-exit "$all" &
+else
+ if [ -n "$1" ] && [ -e "$1" ]; then
+ "$dnd" --and-exit "$1" &
+ fi
+fi
diff --git a/.config/nvim/lua/config/hooks.lua b/.config/nvim/lua/config/hooks.lua
index eaf0687..da0df5d 100644
--- a/.config/nvim/lua/config/hooks.lua
+++ b/.config/nvim/lua/config/hooks.lua
@@ -6,3 +6,12 @@ vim.api.nvim_create_autocmd({"BufWritePre"}, {
vim.fn.setpos(".", save_cursor)
end,
})
+
+vim.api.nvim_create_autocmd("FileType", {
+ pattern = "arduino",
+ callback = function()
+ vim.opt_local.tabstop = 4
+ vim.opt_local.softtabstop = 4
+ vim.opt_local.shiftwidth = 4
+ end,
+})
diff --git a/.config/nvim/lua/lsp/arduino.lua b/.config/nvim/lua/lsp/arduino.lua
index aedfc7d..f0df170 100644
--- a/.config/nvim/lua/lsp/arduino.lua
+++ b/.config/nvim/lua/lsp/arduino.lua
@@ -4,7 +4,8 @@ vim.lsp.config('arduino-language-server', {
'-cli-config', '/home/jozan/.arduino15/arduino-cli.yaml',
'-cli', 'arduino-cli',
'-clangd', 'clangd',
- '-fqbn', 'esp32:esp32:esp32',
+ '-fqbn', 'esp8266:esp8266:d1_mini',
+ '-jobs', '3',
},
filetypes = {'arduino'},
root_markers = {'.git'},