Compare commits
3
Commits
47759491ee
...
925c71cbaa
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
925c71cbaa | ||
|
|
6c2b24c71c | ||
|
|
77841d8f3d |
No files matched your search
@@ -9,15 +9,15 @@ TERM = "xterm-256color"
|
||||
size = 14
|
||||
|
||||
[font.bold]
|
||||
family = "Fira Mono for Powerline"
|
||||
family = "FiraMono Nerd Font Mono"
|
||||
style = "Bold"
|
||||
|
||||
[font.italic]
|
||||
family = "Fira Mono for Powerline"
|
||||
family = "FiraMono Nerd Font Mono"
|
||||
style = "Regular"
|
||||
|
||||
[font.normal]
|
||||
family = "Fira Mono for Powerline"
|
||||
family = "FiraMono Nerd Font Mono"
|
||||
style = "Medium"
|
||||
|
||||
[[keyboard.bindings]]
|
||||
@@ -60,7 +60,7 @@ y = 0
|
||||
[[keyboard.bindings]]
|
||||
key = "Return"
|
||||
mods = "Shift"
|
||||
chars = "\u001B\r"
|
||||
chars = "\u001B[13;2u"
|
||||
|
||||
[[keyboard.bindings]]
|
||||
key = "Slash"
|
||||
|
||||
@@ -0,0 +1,66 @@
|
||||
" Table cell jumps without table mode ([| ]| {| }|)
|
||||
function! s:CellMaps()
|
||||
nmap <buffer> [<Bar> <Plug>(table-mode-motion-left)
|
||||
nmap <buffer> ]<Bar> <Plug>(table-mode-motion-right)
|
||||
nmap <buffer> {<Bar> <Plug>(table-mode-motion-up)
|
||||
nmap <buffer> }<Bar> <Plug>(table-mode-motion-down)
|
||||
endfunction
|
||||
call s:CellMaps()
|
||||
" Leaving table mode unmaps them, so restore
|
||||
augroup markdown_cell_maps
|
||||
autocmd! * <buffer>
|
||||
autocmd User TableModeDisabled if &filetype ==# 'markdown' | call s:CellMaps() | endif
|
||||
augroup END
|
||||
|
||||
" <Leader>T{h,j,k,l} and <Leader><Arrow> jump one cell
|
||||
nmap <buffer> <Leader>Th <Plug>(table-mode-motion-left)
|
||||
nmap <buffer> <Leader>Tj <Plug>(table-mode-motion-down)
|
||||
nmap <buffer> <Leader>Tk <Plug>(table-mode-motion-up)
|
||||
nmap <buffer> <Leader>Tl <Plug>(table-mode-motion-right)
|
||||
nmap <buffer> <Leader><Left> <Plug>(table-mode-motion-left)
|
||||
nmap <buffer> <Leader><Down> <Plug>(table-mode-motion-down)
|
||||
nmap <buffer> <Leader><Up> <Plug>(table-mode-motion-up)
|
||||
nmap <buffer> <Leader><Right> <Plug>(table-mode-motion-right)
|
||||
|
||||
" <Leader>x toggles a checkbox; adds one to plain lines and list items
|
||||
lua << EOF
|
||||
local function toggle(lnum)
|
||||
local line = vim.fn.getline(lnum)
|
||||
local indent, marker, state, rest = line:match('^(%s*)([-*+] )%[([ xX])%] ?(.*)$')
|
||||
if not indent then
|
||||
indent, marker, state, rest = line:match('^(%s*)(%d+[.)] )%[([ xX])%] ?(.*)$')
|
||||
end
|
||||
if indent then
|
||||
state = state == ' ' and 'x' or ' '
|
||||
else
|
||||
indent, marker, rest = line:match('^(%s*)([-*+] )(.*)$')
|
||||
if not indent then
|
||||
indent, marker, rest = line:match('^(%s*)(%d+[.)] )(.*)$')
|
||||
end
|
||||
if not indent then
|
||||
indent, rest = line:match('^(%s*)(.*)$')
|
||||
marker = '- '
|
||||
end
|
||||
state = ' '
|
||||
end
|
||||
vim.fn.setline(lnum, indent .. marker .. '[' .. state .. '] ' .. rest)
|
||||
end
|
||||
vim.keymap.set('n', '<Leader>x', function() toggle(vim.fn.line('.')) end,
|
||||
{ buffer = true, desc = 'Toggle checkbox' })
|
||||
vim.keymap.set('x', '<Leader>x', function()
|
||||
local a, b = vim.fn.line('v'), vim.fn.line('.')
|
||||
for l = math.min(a, b), math.max(a, b) do toggle(l) end
|
||||
vim.api.nvim_feedkeys(vim.keycode('<Esc>'), 'n', false)
|
||||
end, { buffer = true, desc = 'Toggle checkboxes' })
|
||||
|
||||
-- Shift+arrows jump cells on table rows, keep their default elsewhere
|
||||
for key, dir in pairs({ Left = 'left', Down = 'down', Up = 'up', Right = 'right' }) do
|
||||
vim.keymap.set('n', '<Plug>(md-S-' .. key .. ')', '<S-' .. key .. '>', { buffer = true })
|
||||
vim.keymap.set('n', '<S-' .. key .. '>', function()
|
||||
if vim.fn.getline('.'):match('^%s*|') then
|
||||
return '<Plug>(table-mode-motion-' .. dir .. ')'
|
||||
end
|
||||
return '<Plug>(md-S-' .. key .. ')'
|
||||
end, { buffer = true, expr = true, remap = true, desc = 'Table cell or default' })
|
||||
end
|
||||
EOF
|
||||
@@ -92,6 +92,12 @@ Plug 'pangloss/vim-javascript'
|
||||
" Tex
|
||||
Plug 'lervag/vimtex'
|
||||
|
||||
" Markdown
|
||||
Plug 'nvim-tree/nvim-web-devicons'
|
||||
Plug 'MeanderingProgrammer/render-markdown.nvim'
|
||||
Plug 'dhruvasagar/vim-table-mode'
|
||||
Plug 'stevearc/conform.nvim'
|
||||
|
||||
"Go
|
||||
Plug 'fatih/vim-go'
|
||||
|
||||
@@ -498,5 +504,45 @@ try
|
||||
catch
|
||||
" Ignore non existing file
|
||||
endtry
|
||||
" Markdown
|
||||
if !exists('g:vscode')
|
||||
" Table mode under <Leader>T (<Leader>t is TextWrapToggle)
|
||||
let g:table_mode_corner = '|' " GFM-valid delimiter row
|
||||
let g:table_mode_map_prefix = '<Leader>T'
|
||||
let g:table_mode_tableize_d_map = '<Leader>Td'
|
||||
|
||||
lua << EOF
|
||||
-- Only tables and checkboxes; everything else stays plain markdown
|
||||
local off = { enabled = false }
|
||||
require('render-markdown').setup({
|
||||
-- gutter signs open the signcolumn after wrapped tables are sized -> overflow
|
||||
sign = off,
|
||||
heading = off, code = off, dash = off, bullet = off, quote = off, link = off,
|
||||
html = off, latex = off, yaml = off, inline_highlight = off,
|
||||
checkbox = { unchecked = { icon = ' ' }, checked = { icon = ' ' } },
|
||||
})
|
||||
vim.keymap.set('n', '<Leader>mr', '<cmd>RenderMarkdown toggle<CR>', { desc = 'Toggle render markdown' })
|
||||
|
||||
-- Prettier aligns tables on save; :FormatToggle disables it per buffer
|
||||
require('conform').setup({
|
||||
formatters_by_ft = { markdown = { 'prettier' } },
|
||||
formatters = {
|
||||
prettier = { prepend_args = { '--prose-wrap', 'preserve', '--print-width', '120' } },
|
||||
},
|
||||
-- async: Node startup can be slow, don't block :w
|
||||
format_after_save = function(bufnr)
|
||||
if vim.g.disable_autoformat or vim.b[bufnr].disable_autoformat then return end
|
||||
return {}
|
||||
end,
|
||||
})
|
||||
vim.api.nvim_create_user_command('FormatToggle', function()
|
||||
vim.b.disable_autoformat = not vim.b.disable_autoformat
|
||||
print('Format on save ' .. (vim.b.disable_autoformat and 'off' or 'on'))
|
||||
end, {})
|
||||
vim.keymap.set('n', '<Leader>F', function() require('conform').format({ async = true }) end,
|
||||
{ desc = 'Format document' })
|
||||
EOF
|
||||
endif
|
||||
|
||||
let g:tex_flavor = "latex"
|
||||
autocmd FileType yaml setlocal ts=2 sts=2 sw=2 expandtab
|
||||
+1
-1
@@ -9,7 +9,7 @@ set -e
|
||||
|
||||
sudo pacman --needed -Sy archlinux-keyring --noconfirm
|
||||
sudo pacman --needed -Syu --noconfirm
|
||||
sudo pacman --needed -Sy base-devel gnome neovim zsh tmux openssh alacritty powerline-fonts python-pip python-pynvim --noconfirm
|
||||
sudo pacman --needed -Sy base-devel gnome neovim zsh tmux openssh alacritty powerline-fonts otf-firamono-nerd prettier python-pip python-pynvim --noconfirm
|
||||
|
||||
./clone_and_link.sh
|
||||
./copy_fonts_arch.sh
|
||||
|
||||
+2
-1
@@ -6,7 +6,8 @@
|
||||
# Distributed under terms of the MIT license.
|
||||
#
|
||||
|
||||
brew install neovim tmux coreutils cmake golang jq npm virtualenvwrapper
|
||||
brew install neovim tmux coreutils cmake golang jq npm prettier virtualenvwrapper
|
||||
brew install --cask font-fira-mono-nerd-font
|
||||
./install_alacritty_mac.sh
|
||||
BREW_PREFIX="$(brew --prefix)"
|
||||
source "$BREW_PREFIX/bin/virtualenvwrapper.sh"
|
||||
|
||||
@@ -26,6 +26,8 @@ bind -T off F12 \
|
||||
|
||||
setw -g mode-keys vi
|
||||
set-option -g status-keys vi
|
||||
set -g extended-keys on
|
||||
set -g extended-keys-format csi-u
|
||||
|
||||
# Splits keep the source pane's cwd AND its active Python venv. #{@venv} is set
|
||||
# per-pane by the shell (see .virtual_env_config.zsh); we go through run-shell
|
||||
|
||||
Reference in new issue
Block a user