From 8cead0307a393d7991e5727b241c269e36a61428 Mon Sep 17 00:00:00 2001 From: _N0x Date: Mon, 11 Oct 2021 15:01:51 +0200 Subject: [PATCH] minor nvim changes --- nvim/.config/nvim/init.vim | 3 +-- nvim/.local/share/nvim/site/autoload/plug.vim | 14 +++++++++----- 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/nvim/.config/nvim/init.vim b/nvim/.config/nvim/init.vim index 058b06b..f632f24 100644 --- a/nvim/.config/nvim/init.vim +++ b/nvim/.config/nvim/init.vim @@ -25,7 +25,7 @@ Plug 'preservim/nerdtree', {'on': 'NERDTreeToggle'} Plug 'arcticicestudio/nord-vim' Plug 'mg979/vim-visual-multi' Plug 'mbbill/undotree' -"Plug 'hugolgst/vimsence'" +Plug 'hugolgst/vimsence' call plug#end() " colorscheme stuff " @@ -36,7 +36,6 @@ let g:vimsence_small_image = 'neovim' let g:vimsence_editing_details = 'Editing: {}' let g:vimsence_editing_state = 'Working on: {}' - " Keybinds " let mapleader = " " diff --git a/nvim/.local/share/nvim/site/autoload/plug.vim b/nvim/.local/share/nvim/site/autoload/plug.vim index 2b89b5a..6a958cb 100644 --- a/nvim/.local/share/nvim/site/autoload/plug.vim +++ b/nvim/.local/share/nvim/site/autoload/plug.vim @@ -116,6 +116,10 @@ let s:TYPE = { let s:loaded = get(s:, 'loaded', {}) let s:triggers = get(s:, 'triggers', {}) +function! s:is_powershell(shell) + return a:shell =~# 'powershell\(\.exe\)\?$' || a:shell =~# 'pwsh\(\.exe\)\?$' +endfunction + function! s:isabsolute(dir) abort return a:dir =~# '^/' || (has('win32') && a:dir =~? '^\%(\\\|[A-Z]:\)') endfunction @@ -263,7 +267,7 @@ function! s:define_commands() endif if has('win32') \ && &shellslash - \ && (&shell =~# 'cmd\(\.exe\)\?$' || &shell =~# 'powershell\(\.exe\)\?$') + \ && (&shell =~# 'cmd\(\.exe\)\?$' || s:is_powershell(&shell)) return s:err('vim-plug does not support shell, ' . &shell . ', when shellslash is set.') endif if !has('nvim') @@ -503,7 +507,7 @@ if s:is_win let batchfile = s:plug_tempname().'.bat' call writefile(s:wrap_cmds(a:cmd), batchfile) let cmd = plug#shellescape(batchfile, {'shell': &shell, 'script': 0}) - if &shell =~# 'powershell\(\.exe\)\?$' + if s:is_powershell(&shell) let cmd = '& ' . cmd endif return [batchfile, cmd] @@ -984,7 +988,7 @@ function! s:chsh(swap) set shell=sh endif if a:swap - if &shell =~# 'powershell\(\.exe\)\?$' || &shell =~# 'pwsh$' + if s:is_powershell(&shell) let &shellredir = '2>&1 | Out-File -Encoding UTF8 %s' elseif &shell =~# 'sh' || &shell =~# 'cmd\(\.exe\)\?$' set shellredir=>%s\ 2>&1 @@ -2225,7 +2229,7 @@ function! plug#shellescape(arg, ...) let script = get(opts, 'script', 1) if shell =~# 'cmd\(\.exe\)\?$' return s:shellesc_cmd(a:arg, script) - elseif shell =~# 'powershell\(\.exe\)\?$' || shell =~# 'pwsh$' + elseif s:is_powershell(shell) return s:shellesc_ps1(a:arg) endif return s:shellesc_sh(a:arg) @@ -2277,7 +2281,7 @@ function! s:system(cmd, ...) return system(a:cmd) endif let cmd = join(map(copy(a:cmd), 'plug#shellescape(v:val, {"shell": &shell, "script": 0})')) - if &shell =~# 'powershell\(\.exe\)\?$' + if s:is_powershell(&shell) let cmd = '& ' . cmd endif else