Compare commits

..

3 Commits

5 changed files with 35 additions and 13 deletions

View File

@@ -25,12 +25,11 @@ Plug 'lervag/vimtex', { 'for': ['tex'] }
Plug 'arcticicestudio/nord-vim'
Plug 'rhysd/vim-grammarous'
Plug 'jalvesaq/Nvim-R', {'branch': 'stable', 'for': ['r', 'R', 'Rmd', 'rmd']}
Plug 'luk400/vim-jukit'
"Plug 'luk400/vim-jukit'
Plug 'David-Kunz/gen.nvim'
Plug 'othree/html5.vim'
Plug 'pangloss/vim-javascript'
Plug 'evanleck/vim-svelte', {'branch': 'main'}
Plug 'github/copilot.vim',
Plug 'nathangrigg/vim-beancount'
call plug#end()
@@ -38,7 +37,7 @@ let g:vimwiki_list = [{'path': '~/dox/notes/', 'index': 'Main'}]
set title
set bg=light
set go=a
"set go=a
set mouse=a
set nohlsearch
set clipboard+=unnamedplus
@@ -49,6 +48,13 @@ set noshowcmd
set undofile
colorscheme nord
" Use terminal background (transparent)
highlight Normal ctermbg=NONE guibg=NONE
highlight NonText ctermbg=NONE guibg=NONE
highlight LineNr ctermbg=NONE guibg=NONE
highlight SignColumn ctermbg=NONE guibg=NONE
highlight EndOfBuffer ctermbg=NONE guibg=NONE
" Some basics:
nnoremap c "_c
set nocompatible
@@ -69,7 +75,8 @@ colorscheme nord
" Goyo plugin makes text more readable when writing prose:
map <leader>f :Goyo \| set bg=light \| set linebreak<CR>
" Spell-check set to <leader>o, 'o' for 'orthography':
map <leader>o :setlocal spell! spelllang=en_us<CR>
map <leader>o :setlocal spell! spelllang=en_us<CR>:syntax on<CR>
map <leader>O :setlocal spell! spelllang=de_ch<CR>:syntax on<CR>
" Splits open at the bottom and right, which is non-retarded, unlike vim defaults.
set splitbelow splitright
@@ -87,11 +94,6 @@ endfunction
" Automatically compile RMarkdown on buffer write
autocmd BufWritePost *.Rmd call CompileRMarkdown()
""" GitHub Copilot
" remap accept to <C-J> instead of <CR>
imap <silent><script><expr> <C-J> copilot#Accept("\<CR>")
let g:copilot_no_tab_map = v:true
" Python Notebooks using jukit
let g:_jukit_python_os_cmd = 'python'
@@ -439,8 +441,7 @@ set hidden
set nobackup
set nowritebackup
" Give more space for displaying messages.
set cmdheight=2
set cmdheight=1
" Having longer updatetime (default is 4000 ms = 4 s) leads to noticeable
" delays and poor user experience.
@@ -626,3 +627,6 @@ nnoremap <silent><nowait> <space>p :<C-u>CocListResume<CR>
inoremap <expr> <cr> pumvisible() ? "\<C-y>" : "\<C-g>u\<CR>"
inoremap <silent><expr> <NUL> coc#refresh()
""" Set the foldlevel to 99 (beancount)
set foldlevel=99

View File

@@ -60,3 +60,20 @@ class my_edit(Command):
# This is a generic tab-completion function that iterates through the
# content of the current directory.
return self._tab_directory_content()
class smart_shell(Command):
""":smart_shell
If SHLVL == 1, spawn a new shell in the current directory.
If SHLVL > 1, quit ranger (same as pressing 'q').
"""
def execute(self):
shlvl = int(os.environ.get('SHLVL', 1))
if shlvl > 1:
# We're in a nested shell, quit ranger to return to parent shell
self.fm.execute_console('quit')
else:
# Top-level shell, spawn a new shell
self.fm.execute_command(os.environ.get('SHELL', '/bin/sh'))

View File

@@ -347,7 +347,7 @@ map i display_file
map ? help
map W display_log
map w taskview_open
map S shell $SHELL
map S smart_shell
map : console
map ; console

View File

@@ -164,6 +164,7 @@ ext pdf, has qpdfview, X, flag f = qpdfview "$@"
ext pdf, has open, X, flag f = open "$@"
mime application/pdf, has zathura, X, flag f = zathura -- "$@"
ext docx, has libreoffice, X, flag f = libreoffice "$@"
ext docx?, has catdoc, terminal = catdoc -- "$@" | "$PAGER"
ext sxc|xlsx?|xlt|xlw|gnm|gnumeric, has gnumeric, X, flag f = gnumeric -- "$@"

View File

@@ -84,7 +84,7 @@ handle_extension() {
## Preview as text conversion
odt2txt "${FILE_PATH}" && exit 5
## Preview as markdown conversion
pandoc -s -t markdown -- "${FILE_PATH}" && exit 5
# pandoc -s -t markdown -- "${FILE_PATH}" && exit 5
exit 1;;
## XLSX