1
0

Various amazing stuff

This commit is contained in:
Gürkan 2023-04-21 21:47:10 +02:00
parent a4d5799d90
commit 36cb3c2f3b

25
nix.vim
View File

@ -3,10 +3,8 @@ filetype off " required
set shell=/run/current-system/sw/bin/sh
" use undo directory to store undo files between sessions
if isdirectory('~/.local/share/vim-undo')
set undodir=~/.local/share/vim-undo
set undofile
endif
set undodir=~/.local/share/vim-undo
set undofile
" detect remote sessions
let g:remoteSession = ($SSH_CLIENT != "")
@ -66,10 +64,14 @@ augroup illuminate_augroup
augroup END
" Return to last edit position when opening files
autocmd BufReadPost *
\ if line("'\"") > 0 && line("'\"") <= line("$") |
\ exe "normal! g`\"" |
\ endif
" except for gitcommit files
let no_cursor_position_ft = [ 'gitcommit' ]
if index(no_cursor_position_ft, &ft) < 0
autocmd BufReadPost *
\ if line("'\"") > 0 && line("'\"") <= line("$") |
\ exe "normal! g`\"" |
\ endif
endif
let g:NERDSpaceDelims = 1
" Comment with Crtl-C
@ -117,6 +119,10 @@ end
vim.keymap.set('i', '<C-right>', function() jumpy() end)
vim.keymap.set('n', '<C-right>', function() jumpy(true) end)
-- Copilot
vim.keymap.set('i', '<C-Down>', "<Plug>(copilot-next)", {})
vim.keymap.set('i', '<C-Up>', "<Plug>(copilot-previous)", {})
-- Telescope
local actions = require("telescope.actions")
local fb_actions = require "telescope._extensions.file_browser.actions"
@ -140,6 +146,7 @@ extensions = {
},
},
defaults = {
dynamic_preview_title = true,
mappings = {
i = {
-- Quit via Esc in insert mode
@ -215,6 +222,8 @@ require("yanky").setup({
require("telescope").load_extension("yank_history")
vim.keymap.set({"n","x"}, "p", "<Plug>(YankyPutAfter)")
vim.keymap.set({"n","x"}, "P", "<Plug>(YankyPutBefore)")
vim.keymap.set("n", "<c-p>", "<Plug>(YankyCycleForward)")
vim.keymap.set("n", "<c-n>", "<Plug>(YankyCycleBackward)")
-- leap
require('leap').set_default_keymaps(true)