From 925d51b7170acd6d7594b3a80bb387fbd59e726d Mon Sep 17 00:00:00 2001 From: PlexSheep Date: Sat, 25 Mar 2023 18:45:49 +0100 Subject: [PATCH] vimrc some relocations --- home/.config/nvim/common.vim | 33 +++--------- home/.config/nvim/main.vim | 17 ++++++ home/.config/nvim/noplug.vim | 101 +++++++++++++++++++++++++++++++++++ 3 files changed, 124 insertions(+), 27 deletions(-) create mode 100644 home/.config/nvim/noplug.vim diff --git a/home/.config/nvim/common.vim b/home/.config/nvim/common.vim index 52e1a73..7a2d42f 100644 --- a/home/.config/nvim/common.vim +++ b/home/.config/nvim/common.vim @@ -1,10 +1,3 @@ -call plug#begin() - -Plug 'glacambre/firenvim', { 'do': { _ -> firenvim#install(0) } } -Plug 'jiangmiao/auto-pairs' -Plug 'EdenEast/nightfox.nvim' " Vim-Plug - -call plug#end() syntax on " syntax highlighting set nocompatible " disable compatibility to old-time vi @@ -40,10 +33,14 @@ filetype plugin on " let g:indentLine_setColors = 0 let g:indentLine_char = '│' -" set timeout to wait for shortcuts with a prefix +" add lines with double o noremap oo o noremap OO O +" H and L for end and beginning +nmap H ^ +nmap L $ + " hit f3 to toggle search highlighting" nnoremap :set hlsearch! @@ -64,7 +61,7 @@ nnoremap Y "+Y nnoremap y "+y nnoremap yy "+yy -" dont write the pastet upon stuff in visual mode into the register +" dont write the pasted upon stuff in visual mode into the register vnoremap p pgvy " open terminal with F12 @@ -75,21 +72,3 @@ map " :vsplit " split with , then %" map % :split - -" enter normal mode from terminal-emulator with -inoremap -tnoremap - -" automatically enter insert mode on new neovim terminals -augroup terminal - au TermOpen * startinsert -augroup END - -" Set completeopt to have a better completion experience" -set completeopt=menuone,noinsert,noselect -" debuging -packadd termdebug - -" debuggin for rust -command Rustdebug :let termdebugger="rust-gdb" | :Termdebug - diff --git a/home/.config/nvim/main.vim b/home/.config/nvim/main.vim index 3630bf9..bb4e77c 100644 --- a/home/.config/nvim/main.vim +++ b/home/.config/nvim/main.vim @@ -1,5 +1,22 @@ +" enter normal mode from terminal-emulator with +inoremap +tnoremap + +" automatically enter insert mode on new neovim terminals +augroup terminal + au TermOpen * startinsert +augroup END + +" debuging +packadd termdebug + +" debugging for rust +command Rustdebug :let termdebugger="rust-gdb" | :Termdebug + " :W to write file as root" command W :SudaWrite +" Set completeopt to have a better completion experience" +set completeopt=menuone,noinsert,noselect " :E to open file as root" command E :SudaRead diff --git a/home/.config/nvim/noplug.vim b/home/.config/nvim/noplug.vim new file mode 100644 index 0000000..37349c5 --- /dev/null +++ b/home/.config/nvim/noplug.vim @@ -0,0 +1,101 @@ +syntax on " syntax highlighting + +set nocompatible " disable compatibility to old-time vi +set mouse=v " middle-click paste with +set number +set nocompatible +set hlsearch " highlight search +set incsearch " incremental search +set tabstop=4 " number of columns occupied by a tab +set softtabstop=4 " see multiple spaces as tabstops so does the right thing +set expandtab " converts tabs to white space +set shiftwidth=4 " width for autoindents +set autoindent " indent a new line the same amount as the line just typed +set number " add line numbers +set wildmode=longest,list " get bash-like tab completions +set cc=100 " set an 100 column border for good coding style +set mouse=a " enable mouse click +set cursorline " highlight current cursorline +set ttyfast " Speed up scrolling in Vim +set fdm=indent " foldingmethod syntax +set foldlevel=10 " only fold when a certain complexity is reached by default. This applies only at startup. +"set spell " enable spell check (may need to download language package) +set timeout timeoutlen=400 +set ttimeoutlen=0 + +" Avoid showing message extra message when using completion" +set shortmess+=c + +filetype plugin indent on "allow auto-indenting depending on file type +filetype plugin on + + +" let g:indentLine_setColors = 0 +let g:indentLine_char = '│' + +" set timeout to wait for shortcuts with a prefix +noremap oo o +noremap OO O + +" hit f3 to toggle search highlighting" +nnoremap :set hlsearch! + +nnoremap +let mapleader=" " +map t :echo "leader tested!" +map h :noh + +" copy to wayland clipboard when leader is used. (note, install gvim for this) +vnoremap wy y :call system("wl-copy", @") +nnoremap wY Y :call system("wl-copy", @") +nnoremap wy y :call system("wl-copy", @") +nnoremap wyy yy :call system("wl-copy", @") + +" copy to system clipboard when leader is used. (note, install gvim for this) +vnoremap y "+y +nnoremap Y "+Y +nnoremap y "+y +nnoremap yy "+yy + +" dont write the pastet upon stuff in visual mode into the register +vnoremap p pgvy + +" open terminal with F12 +nnoremap :terminal + +" automatically set closed braces aswell when making opened ones. +"inoremap " "" +"inoremap ' '' +"inoremap ( () +"inoremap [ [] +"inoremap { {} +"inoremap { {}O +"inoremap {; {};O + +" vsplit with , then " +map " :vsplit + +" split with , then %" +map % :split + +" automatically enter insert mode on new neovim terminals +augroup terminal + au TermOpen * startinsert +augroup END + +" enter normal mode from terminal-emulator with +inoremap +tnoremap + +" :W to write file as root" +command W :SudaWrite + +" :E to open file as root" +command E :SudaRead +" Set completeopt to have a better completion experience" +set completeopt=menuone,noinsert,noselect +" debuging +packadd termdebug + +" debuggin for rust +command Rustdebug :let termdebugger="rust-gdb" | :Termdebug