From 1b2b8f3ba2c0c598d9cc6267d7cef25e4acb79c8 Mon Sep 17 00:00:00 2001 From: d0zingcat Date: Wed, 20 Mar 2024 14:12:45 +0800 Subject: [PATCH] chore: update Signed-off-by: d0zingcat --- .tmux.conf | 2 +- nvim/init.lua | 21 ++++++++++++++------- 2 files changed, 15 insertions(+), 8 deletions(-) diff --git a/.tmux.conf b/.tmux.conf index 9ab74d1..cfa4bf4 100644 --- a/.tmux.conf +++ b/.tmux.conf @@ -75,7 +75,7 @@ set -g @plugin 'tmux-plugins/tpm' set -g @plugin 'tmux-plugins/tmux-sensible' set -g @plugin 'tmux-plugins/tmux-resurrect' set -g @plugin 'tmux-plugins/tmux-continuum' -set -g @continuum-restore 'on' +set -g @continuum-restore 'off' set -g @continuum-save-interval '30' # Colors diff --git a/nvim/init.lua b/nvim/init.lua index dbcc8b4..99e4c6a 100644 --- a/nvim/init.lua +++ b/nvim/init.lua @@ -19,15 +19,15 @@ local set = utils.set -- Preset -- Prerequisites Must have neovim installed if fn.has('nvim') == 0 then - return + return end -- Ensure packer installed local install_path = fn.stdpath('data') .. '/site/pack/packer/start/packer.nvim' if fn.empty(fn.glob(install_path)) > 0 then - fn.system({ 'git', 'clone', '--depth', '1', 'https://github.com/wbthomason/packer.nvim', install_path }) - cmd('packadd packer.nvim') + fn.system({ 'git', 'clone', '--depth', '1', 'https://github.com/wbthomason/packer.nvim', install_path }) + cmd('packadd packer.nvim') end -- reopen last position @@ -55,7 +55,7 @@ cmd([[ autocmd FileType yaml setlocal tabstop=2 shiftwidth=2 softtabstop=2 textw cmd([[ autocmd FileType ruby setlocal tabstop=2 shiftwidth=2 softtabstop=2 textwidth=120 ]]) cmd([[ autocmd FileType less,sass,scss,css setlocal tabstop=2 shiftwidth=2 softtabstop=2 textwidth=120 ]]) cmd( - [[ autocmd FileType javascript,javascript.jsx,javascriptreact,typescript,typescriptreact setlocal tabstop=2 shiftwidth=2 softtabstop=4 expandtab ]] + [[ autocmd FileType javascript,javascript.jsx,javascriptreact,typescript,typescriptreact setlocal tabstop=2 shiftwidth=2 softtabstop=4 expandtab ]] ) cmd([[iabbrev pdb import pdb; pdb.set_trace()]]) @@ -172,7 +172,7 @@ require('funcs') -- Neoformat if not fn.executable('luafmt') then - cmd([[ :!npm install -g lua-fmt]]) + cmd([[ :!npm install -g lua-fmt]]) end -- barbar @@ -190,9 +190,16 @@ map('n', '-', '(choosewin)', { noremap = false }) -- end -- }) +vim.api.nvim_set_keymap('n', 'of', ':lua OpenFinder()', { noremap = true, silent = true }) + +function OpenFinder() + local current_path = vim.fn.expand('%:p:h') + vim.cmd('!open ' .. current_path) +end + -- Some configurations not able to migrate api.nvim_exec( - [[ + [[ " set nocompatible "function! NearestMethodOrFunction() abort " return get(b:, 'vista_nearest_method_or_function', '') @@ -200,5 +207,5 @@ api.nvim_exec( " "set statusline+=%{NearestMethodOrFunction()} ]], - false + false )