diff --git a/Internal/os_nvim_init.vim b/Internal/os_nvim_init.vim index 94a52cf..1da0ab0 100644 --- a/Internal/os_nvim_init.vim +++ b/Internal/os_nvim_init.vim @@ -63,10 +63,12 @@ lua <cc FzfCommits nnoremap cb FzfBCommits nnoremap b FzfBuffers +function! PadAndTruncateLineTo80Function() + let line = getline('.') + let line_length = strlen(line) + let padding = 80 - line_length + let padding = max([padding, 0]) + + let existing_space = line_length == 80 || match(line, ' $') != -1 + + " Construct the new line with padding and a space before the padding + let new_line = line . (existing_space ? '' : ' ') . repeat('=', padding - 1) + + call setline(line('.'), new_line) +endfunction +command! PadAndTruncateLineTo80 :call PadAndTruncateLineTo80Function() +nnoremap :PadAndTruncateLineTo80 + nnoremap RemedyBGOpenFile nnoremap RemedyBGStartDebugging nnoremap RemedyBGStopDebugging