From 1e7ad1e89af5ecafcdec764c906fe604b1155e85 Mon Sep 17 00:00:00 2001 From: Stefan Imhoff Date: Thu, 2 Dec 2021 18:53:25 +0100 Subject: [PATCH] chore(nvim): add functions --- nvim/init.vim | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/nvim/init.vim b/nvim/init.vim index da63498..d7fde8e 100644 --- a/nvim/init.vim +++ b/nvim/init.vim @@ -59,6 +59,7 @@ set dictionary+=~/.config/nvim/dictionary/en_us.txt set thesaurus+=~/.config/nvim/thesaurus/de_user.txt set thesaurus+=~/.config/nvim/thesaurus/de_openthesaurus.txt + " *** *** *** Key Mappings *** *** *** " ************************************ @@ -149,3 +150,24 @@ nnoremap nnoremap nnoremap + +" *** *** *** Functions *** *** *** +" ********************************* + +" Toggle between soft wrap and no wrap +nnoremap tw :call ToggleWrap() + +function! ToggleWrap() + if &wrap + echo "Wrap OFF" + set nowrap + set nolinebreak + set virtualedit=all + else + echo "Wrap ON" + set wrap + set linebreak + set virtualedit= + setlocal display+=lastline + endif +endfunction