diff --git a/tycho/nvim/init.lua b/tycho/nvim/init.lua index 68d4134..6311c92 100644 --- a/tycho/nvim/init.lua +++ b/tycho/nvim/init.lua @@ -5,7 +5,9 @@ vim.g.mapleader = "," -- load legacy options vim.cmd([[ - so ~/.config/nvim/legacy.vim + " so ~/.config/nvim/legacy.vim + let $FZF_DEFAULT_COMMAND = 'rg --files --hidden' + let g:tex_flavor='latex' ]]) require('completion') @@ -47,3 +49,58 @@ require("bufferline").setup{} if vim.g.neovide then vim.o.guifont = "Iosevka Term Medium:h12" end + +vim.opt.backspace = "indent,eol,start" + +-- fix auto-completion +vim.opt.wildmenu = true +vim.opt.wildignorecase = true +vim.opt.wildignore = "*.o,*~,*.pyc,*.aux,*.bbl,*.blg,*-blx.bib,*.log,*.out,*.run.xml,*.toc,*.nav,*.snm" + +-- BUFFER HANDLING --------------------------------- +-- automatically reload files changed on disk but not in buffer +vim.opt.autoread = true +-- hide buffers on switch +vim.opt.hidden = true + +-- OPTICS & NUMBERING BEHAVIOUR -------------------- +vim.opt.number = true +vim.opt.relativenumber = true +vim.opt.tabstop = 4 +vim.opt.shiftwidth = 4 +vim.opt.expandtab = true +-- keep 5 lines of context above/below the cursor (if possible) +vim.opt.scrolloff = 5 + + +-- SEARCH ------------------------------------------ +-- highlight all search results +vim.opt.hlsearch = true +-- enable smart-case search +vim.opt.smartcase = true +-- always case-insensitive +vim.opt.ignorecase = true +-- searches for strings incrementally +vim.opt.incsearch = true + +-- key bindings +-- empty mode string matches n, v, o +vim.keymap.set("", "h", ":tabp", { desc = "Select previous tab" }) +vim.keymap.set("", "l", ":tabn", { desc = "Select next tab" }) +vim.keymap.set("", "", ":bprevious", { desc = "Select previous buffer" }) +vim.keymap.set("", "", ":bnext", { desc = "Select next buffer" }) + +vim.keymap.set("", "f", ":Files", { desc = "Open FZF file finder" }) +vim.keymap.set("", "bl", ":Buffers", { desc = "Open FZF buffer list" }) + +vim.keymap.set("n", "1", "1w", { noremap = true }) +vim.keymap.set("n", "2", "2w", { noremap = true }) +vim.keymap.set("n", "3", "3w", { noremap = true }) +vim.keymap.set("n", "4", "4w", { noremap = true }) +vim.keymap.set("n", "5", "5w", { noremap = true }) +vim.keymap.set("n", "6", "6w", { noremap = true }) +vim.keymap.set("n", "7", "7w", { noremap = true }) +vim.keymap.set("n", "8", "8w", { noremap = true }) +vim.keymap.set("n", "9", "9w", { noremap = true }) +vim.keymap.set("n", "0", "10w", { noremap = true }) + diff --git a/tycho/nvim/legacy.vim b/tycho/nvim/legacy.vim index 4b0e8c4..a2140be 100644 --- a/tycho/nvim/legacy.vim +++ b/tycho/nvim/legacy.vim @@ -58,23 +58,23 @@ " window switching by # "let g:airline_section_c = '[%{winnr()}] %t' -nnoremap 1 1w -nnoremap 2 2w -nnoremap 3 3w -nnoremap 4 4w -nnoremap 5 5w -nnoremap 6 6w -nnoremap 7 7w -nnoremap 8 8w -nnoremap 9 9w -nnoremap 0 10w +"nnoremap 1 1w +"nnoremap 2 2w +"nnoremap 3 3w +"nnoremap 4 4w +"nnoremap 5 5w +"nnoremap 6 6w +"nnoremap 7 7w +"nnoremap 8 8w +"nnoremap 9 9w +"nnoremap 0 10w " possible setting as alternative for easymotion " let g:sneak#label = 1 -set backspace=indent,eol,start +"set backspace=indent,eol,start -let $FZF_DEFAULT_COMMAND = 'rg --files --hidden' +"let $FZF_DEFAULT_COMMAND = 'rg --files --hidden' " Cycling through windows and tabs " nnoremap j @@ -85,42 +85,42 @@ let $FZF_DEFAULT_COMMAND = 'rg --files --hidden' " nnoremap _ " nnoremap \| " nnoremap \| -map h :tabp -map l :tabn -map :bprevious -map :bnext -map f :Files -map bl :Buffers +"map h :tabp +"map l :tabn +"map :bprevious +"map :bnext +"map f :Files +"map bl :Buffers " fix auto-completion -set wildmenu " show a completion menu -set wildignorecase -set wildignore=*.o,*~,*.pyc,*.aux,*.bbl,*.blg,*-blx.bib,*.log,*.out,*.run.xml, - \*.toc,*.nav,*.snm " ignore auxiliary files +"set wildmenu " show a completion menu +"set wildignorecase +"set wildignore=*.o,*~,*.pyc,*.aux,*.bbl,*.blg,*-blx.bib,*.log,*.out,*.run.xml, + "\*.toc,*.nav,*.snm " ignore auxiliary files " set completeopt-=preview " automatically reload files changed on disk but not in buffer -set autoread +"set autoread " hide buffers on switch -set hidden +"set hidden " tex configuration -let g:tex_flavor='latex' +"let g:tex_flavor='latex' " Optics "colorscheme palenight "gruvbox "set background=dark " Setting dark mode -set number -set relativenumber -set tabstop=4 -set shiftwidth=4 -set expandtab +"set number +"set relativenumber +"set tabstop=4 +"set shiftwidth=4 +"set expandtab " keep 5 lines of context above/below the cursor (if possible) -set scrolloff=5 +"set scrolloff=5 -" Search -set hlsearch " Highlight all search results -set smartcase " Enable smart-case search -set ignorecase " Always case-insensitive -set incsearch " Searches for strings incrementally +"" Search +"set hlsearch " Highlight all search results +"set smartcase " Enable smart-case search +"set ignorecase " Always case-insensitive +"set incsearch " Searches for strings incrementally