Summary Files CommitsBranches @commit@diff
path: root/.vimrc
diff options
context:
space:
mode:
Commitaf93b4366207979b34e0694d145abdc312987023 (patch )
AuthorSyndamia <kamen@syndamia.com>2022-11-20 10:14:47 +0200
CommitterSyndamia <kamen@syndamia.com>2022-11-20 10:14:47 +0200
Files69c27c7a0094c12e5bb16c9094a02ae19557e169 /.vimrc
dotfiles-af93b4366207979b34e0694d145abdc312987023.tar
dotfiles-af93b4366207979b34e0694d145abdc312987023.tar.gz
dotfiles-af93b4366207979b34e0694d145abdc312987023.zip
Parent7b431a2b9f4127bedd39eccf748482d54d6a008b (diff)
[vimrc] Added functionality, where nowrap will be set if a file has a line that is too long
1 files changed, 9 insertions, 1 deletions
-rw-r--r--.vimrc10
diff --git a/.vimrc b/.vimrc
index 21c677c..25e7d69 100644
--- a/.vimrc
+++ b/.vimrc
@@ -45,7 +45,15 @@
" Show tabs as a | with three spaces
" DO NOT remove the trailing space in the next line!
- set listchars=tab:│\
+ set listchars=tab:│\ ,extends:>,precedes:<
+
+ autocmd BufReadPre,FileReadPre * call NoWrapOnLong()
+ function! NoWrapOnLong()
+ let maxline = system("wc -L " . bufname("%") . " | awk '{print $1}'")
+ if maxline > 840
+ set nowrap
+ endif
+ endfunction
" }}}
" Backspace and cursor {{{