Skip to content
Closed

Main #2124

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,7 @@ sudo mkdir -p /opt/nvim-linux-x86_64
sudo chmod a+rX /opt/nvim-linux-x86_64
sudo tar -C /opt -xzf nvim-linux-x86_64.tar.gz

# make it available in /usr/local/bin, distro installs to /usr/bin
# make it available in /usr/local/bin, distro installs to /usr/bi?
sudo ln -sf /opt/nvim-linux-x86_64/bin/nvim /usr/local/bin/
```
</details>
Expand Down
77 changes: 68 additions & 9 deletions init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,7 @@ What is Kickstart?

Kickstart.nvim is a starting point for your own configuration.
The goal is that you can read every line of code, top-to-bottom, understand
what your configuration is doing, and modify it to suit your needs.

Once you've done that, you can start exploring, configuring and tinkering to
what your configuration is doing, and modify it to suit your nee Once you've done that, you can start exploring, configuring and tinkering to
make Neovim your own! That might mean leaving Kickstart just the way it is for a while
or immediately breaking it into modular pieces. It's up to you!

Expand Down Expand Up @@ -97,6 +95,9 @@ do
-- NOTE: Must happen before plugins are loaded (otherwise wrong leader will be used)
vim.g.mapleader = ' '
vim.g.maplocalleader = ' '

-- I set this.
vim.keymap.set('n', '<leader>op', vim.cmd.Ex, { desc = 'Opens netRW' })

-- Set to true if you have a Nerd Font installed and selected in the terminal
vim.g.have_nerd_font = false
Expand Down Expand Up @@ -966,18 +967,76 @@ do
-- Here are some example plugins that I've included in the Kickstart repository.
-- Uncomment any of the lines below to enable them (you will need to restart nvim).
--
-- require 'kickstart.plugins.debug'
-- require 'kickstart.plugins.indent_line'
-- require 'kickstart.plugins.lint'
-- require 'kickstart.plugins.autopairs'
-- require 'kickstart.plugins.neo-tree'
-- require 'kickstart.plugins.gitsigns' -- adds gitsigns recommended keymaps
require 'kickstart.plugins.debug'
require 'kickstart.plugins.indent_line'
require 'kickstart.plugins.lint'
require 'kickstart.plugins.autopairs'
require 'kickstart.plugins.neo-tree'
require 'kickstart.plugins.gitsigns' -- adds gitsigns recommended keymaps

-- NOTE: You can add your own plugins, configuration, etc from `lua/custom/plugins/*.lua`
--
-- Uncomment the following line and add your plugins to `lua/custom/plugins/*.lua` to get going.
-- require 'custom.plugins'
end

local harpoon = require 'harpoon'

-- REQUIRED
harpoon:setup {}
-- REQUIRED

-- basic telescope configuration
local conf = require('telescope.config').values
local function toggle_telescope(harpoon_files)
local file_paths = {}
for _, item in ipairs(harpoon_files.items) do
table.insert(file_paths, item.value)
end

require('telescope.pickers')
.new({}, {
prompt_title = 'Harpoon',
finder = require('telescope.finders').new_table {
results = file_paths,
},
previewer = conf.file_previewer {},
sorter = conf.generic_sorter {},
})
:find()
end

vim.keymap.set('n', '<C-e>', function()
toggle_telescope(harpoon:list())
end, { desc = 'Open harpoon window' })

vim.keymap.set('n', '<leader>a', function()
harpoon:list():add()
end, { desc = 'Add file to harpoon list.' })
vim.keymap.set('n', '<C-e>', function()
harpoon.ui:toggle_quick_menu(harpoon:list())
end, { desc = 'Toggle harpoon quick menu.' })

vim.keymap.set('n', '<leader>1', function()
harpoon:list():select(1)
end, { desc = 'Navigate to file at harpoon posistion 1' })
vim.keymap.set('n', '<leader>2', function()
harpoon:list():select(2)
end, { desc = 'Navigate to file at harpoon posistion 2' })
vim.keymap.set('n', '<leader>3', function()
harpoon:list():select(3)
end, { desc = 'Navigate to file at harpoon posistion 3' })
vim.keymap.set('n', '<leader>4', function()
harpoon:list():select(4)
end, { desc = 'Navigate to file at harpoon posistion 4' })

-- Toggle previous & next buffers stored within Harpoon list
vim.keymap.set('n', '<C-S-P>', function()
harpoon:list():prev()
end, { desc = 'Harpoon previous file' })
vim.keymap.set('n', '<C-S-N>', function()
harpoon:list():next()
end, { desc = 'Harpoon next file' })

-- The line beneath this is called `modeline`. See `:help modeline`
-- vim: ts=2 sts=2 sw=2 et
Loading