]> src.twobees.de Git - dotfiles.git/commitdiff
nvim add telescope and jump to last pos
authorTobias Sachs <rpi6-git-2314-ts@ctsachs.de>
Sun, 27 Nov 2022 17:12:25 +0000 (18:12 +0100)
committerTobias Sachs <rpi6-git-2314-ts@ctsachs.de>
Sun, 27 Nov 2022 17:12:25 +0000 (18:12 +0100)
install/basic
stow/nvim/.config/nvim/lua/mappings.lua
stow/nvim/.config/nvim/lua/plugin_mgr.lua
stow/nvim/.config/nvim/lua/set.lua
stow/zsh/.zshrc

index 010574c60046686a326abbbdd48e1bbd195995c4..f7769c4598077ec3364d231a070dd45c9c013710 100644 (file)
@@ -6,3 +6,4 @@ fzf
 neovim
 stow
 silversearger-ag
+ripgrep
index 0d576c316d08a683818eebc9e94935462f9955ea..4405876bdf00143947ff5dc836daef7c2ea4f2ea 100644 (file)
@@ -68,3 +68,10 @@ vim.keymap.set('n', "<Leader>r", function ()
     print ('config reloaded!')
 end
 )
+
+-- telescope
+local builtin = require('telescope.builtin')
+vim.keymap.set('n', '<leader>ff', builtin.find_files, {})
+vim.keymap.set('n', '<leader>fg', builtin.live_grep, {})
+vim.keymap.set('n', '<leader>fb', builtin.buffers, {})
+vim.keymap.set('n', '<leader>fh', builtin.help_tags, {})
index 319fda1a2315379e87003c52b6a617b633522a3e..f69eee5c9b821a1779363eba41ff62a2881b87f1 100644 (file)
@@ -32,6 +32,11 @@ return require('packer').startup(function(use)
     use { 'hrsh7th/cmp-cmdline' }
     use { 'hrsh7th/nvim-cmp' }
 
+    use {
+        'nvim-telescope/telescope.nvim', branch = '0.1.x',
+        requires = { {'nvim-lua/plenary.nvim'} }
+    }
+
     -- Automatically set up configuration after cloning packer.nvim
     if packer_bootstrap then
         require('packer').sync()
index e2142bd5b1cd9f595ccf5768843e3b674ffb1e84..06abbd458878cf1671eb63b886da9c91aa31988d 100644 (file)
@@ -50,3 +50,12 @@ augroup qs_colors
     autocmd ColorScheme * highlight QuickScopeSecondary guifg='#5fffff' gui=underline ctermfg=81 cterm=underline
 augroup END
 ]]
+
+vim.cmd [[
+augroup jumplast
+    autocmd BufReadPost *
+          \ if line("'\"") >= 1 && line("'\"") <= line("$") && &ft !~# 'commit'
+          \ |   exe "normal! g`\""
+          \ | endif
+augroup END
+]]
index 605f82d96bbc68a36d5b079edb1a97c8eac84c32..d266daae944b33bfc901f1d1723575ab05ea1df4 100644 (file)
@@ -97,6 +97,7 @@ else
     export EDITOR=vim
 fi
 
+alias nvim=$EDITOR
 alias vi=$EDITOR
 alias vim=$EDITOR
 alias ll='ls -lah'