From 33cb8594d5e528892477e82489e4d238fc28a410 Mon Sep 17 00:00:00 2001 From: surdeus Date: Thu, 24 Aug 2023 12:48:42 +0300 Subject: [PATCH] Using nvim now. --- dot/file/profile | 1 + nvim | 1 - nvim/init.lua | 16 ++++++++++++++++ script/lf.sh | 19 +++++++++++++++++++ 4 files changed, 36 insertions(+), 1 deletion(-) delete mode 120000 nvim create mode 100644 nvim/init.lua create mode 100644 script/lf.sh diff --git a/dot/file/profile b/dot/file/profile index 05ec42a..c399db8 100755 --- a/dot/file/profile +++ b/dot/file/profile @@ -53,6 +53,7 @@ export_loop \ MYVIMRC '$HOME/.vimrc'\ test -r $SETENV && . "$SETENV" && setenv profile +test -r $HOME/lib/script/lf.sh && . $HOME/lib/script/lf.sh export GPG_TTY=$(tty) export SSH_TTY=$(tty) diff --git a/nvim b/nvim deleted file mode 120000 index b473bb8..0000000 --- a/nvim +++ /dev/null @@ -1 +0,0 @@ -dot/file/vim \ No newline at end of file diff --git a/nvim/init.lua b/nvim/init.lua new file mode 100644 index 0000000..6a991d6 --- /dev/null +++ b/nvim/init.lua @@ -0,0 +1,16 @@ +vim.o.smarttab = true + +vim.o.swapfile = false + +vim.o.number = true +vim.api.nvim_cmd({ + cmd = 'colorscheme', + args = {'slate'}, +}, {}) + +-- Key mapping +local map = vim.api.nvim_set_keymap +local opts = {noremap = true, silent = true} + +map('n', 'confr', ':source $HOME/lib/nvim/init.lua\n', opts) +map('n', 'confe', ':e $HOME/lib/nvim/init.lua\n', opts) diff --git a/script/lf.sh b/script/lf.sh new file mode 100644 index 0000000..6712883 --- /dev/null +++ b/script/lf.sh @@ -0,0 +1,19 @@ +if test $OS = "Windows_NT" ; then + lf() { + winpty lf + } +fi +lfcd () { + tmp="$(mktemp)" + # `command` is needed in case `lfcd` is aliased to `lf` + command lf -last-dir-path="$tmp" "$@" + if [ -f "$tmp" ]; then + dir="$(cat "$tmp")" + rm -f "$tmp" + if [ -d "$dir" ]; then + if [ "$dir" != "$(pwd)" ]; then + cd "$dir" + fi + fi + fi +}