1
0
Fork 0
mirror of https://github.com/Phantop/dotfiles synced 2024-11-25 00:03:29 +00:00

nvim: cleanup for readability and add quickscope

This commit is contained in:
Phantop 2024-08-04 23:14:48 -04:00
parent 538746ed2e
commit 68675686d9
5 changed files with 21 additions and 16 deletions

View file

@ -1,11 +1,11 @@
vim.filetype.add({ vim.filetype.add{
extension = { extension = {
qb = 'python', qb = 'python',
tac = 'tac', tac = 'tac',
tin = 'cpp', tin = 'cpp',
itin = 'cpp', itin = 'cpp',
} }
}) }
vim.api.nvim_create_autocmd('FileType', { vim.api.nvim_create_autocmd('FileType', {
pattern = 'tac', pattern = 'tac',
callback = function(args) callback = function(args)

View file

@ -1,10 +1,12 @@
vim.g.mapleader = ' '
vim.keymap.set('', '<F7>', 'mzgg=G`z') vim.keymap.set('', '<F7>', 'mzgg=G`z')
vim.keymap.set('', 'r', '"_d') vim.keymap.set('', 'r', '"_d')
vim.g.mapleader = ' '
vim.keymap.set('n', '{', '<cmd>AerialPrev<CR>', { buffer = bufnr }) vim.keymap.set('n', '{', '<cmd>AerialPrev<CR>', { buffer = bufnr })
vim.keymap.set('n', '}', '<cmd>AerialNext<CR>', { buffer = bufnr }) vim.keymap.set('n', '}', '<cmd>AerialNext<CR>', { buffer = bufnr })
vim.keymap.set('n', '<leader>a', '<cmd>AerialToggle!<CR>') vim.keymap.set('n', '<leader>a', '<cmd>AerialToggle!<CR>')
vim.keymap.set('n', 'gd', function() vim.lsp.buf.definition() end) vim.keymap.set('n', 'gd', function() vim.lsp.buf.definition() end)
vim.keymap.set('n', 'gD', function() vim.lsp.buf.type_definition() end) vim.keymap.set('n', 'gD', function() vim.lsp.buf.type_definition() end)
vim.keymap.set('n', '<leader>d', function() vim.lsp.buf.definition() end) vim.keymap.set('n', '<leader>d', function() vim.lsp.buf.definition() end)

View file

@ -14,7 +14,7 @@ local has_words_before = function()
end end
local cmp = require('cmp') local cmp = require('cmp')
cmp.setup({ cmp.setup{
mapping = { mapping = {
['<Tab>'] = cmp.mapping( ['<Tab>'] = cmp.mapping(
function (fallback) function (fallback)
@ -36,10 +36,11 @@ cmp.setup({
{{name = 'buffer'}}, {{name = 'buffer'}},
{{name = 'path'}} {{name = 'path'}}
) )
}) }
local capabilities = require('cmp_nvim_lsp').default_capabilities() local capabilities = require('cmp_nvim_lsp').default_capabilities()
require('lspconfig').clangd.setup{capabilities=capabilities} require('lspconfig').clangd.setup{capabilities=capabilities}
require('mason-lspconfig').setup_handlers { require('mason-lspconfig').setup_handlers{
function (server_name) function (server_name)
require('lspconfig')[server_name].setup {capabilities=capabilities} require('lspconfig')[server_name].setup {capabilities=capabilities}
end end

View file

@ -1,20 +1,16 @@
local paq = require 'paq' { require 'paq' {
'dense-analysis/ale', 'dense-analysis/ale',
'dracula/vim',
'ibhagwan/fzf-lua', 'ibhagwan/fzf-lua',
'kaarmu/typst.vim', 'kaarmu/typst.vim',
'lewis6991/gitsigns.nvim', 'lewis6991/gitsigns.nvim',
'lukas-reineke/indent-blankline.nvim', 'lukas-reineke/indent-blankline.nvim',
'neovim/nvim-lspconfig',
'nmac427/guess-indent.nvim', 'nmac427/guess-indent.nvim',
'nvim-lua/plenary.nvim',
'nvimtools/none-ls.nvim',
'stevearc/aerial.nvim', 'stevearc/aerial.nvim',
'unblevable/quick-scope',
'vim-airline/vim-airline', 'vim-airline/vim-airline',
{ 'nvim-treesitter/nvim-treesitter', build = ':TSUpdate' },
'gbprod/none-ls-shellcheck.nvim', { 'dracula/vim', as = 'dracula' },
{ 'nvim-treesitter/nvim-treesitter', build = ':TSUpdate' },
'L3MON4D3/LuaSnip', 'L3MON4D3/LuaSnip',
'hrsh7th/cmp-buffer', 'hrsh7th/cmp-buffer',
@ -24,16 +20,21 @@ local paq = require 'paq' {
'hrsh7th/cmp-path', 'hrsh7th/cmp-path',
'hrsh7th/nvim-cmp', 'hrsh7th/nvim-cmp',
'nvim-lua/plenary.nvim',
'nvimtools/none-ls.nvim',
'gbprod/none-ls-shellcheck.nvim',
'neovim/nvim-lspconfig',
'williamboman/mason-lspconfig.nvim', 'williamboman/mason-lspconfig.nvim',
{ 'williamboman/mason.nvim', build = ':MasonUpdate' }, { 'williamboman/mason.nvim', build = ':MasonUpdate' },
} }
require('aerial').setup() require('aerial').setup()
require('gitsigns').setup() require('gitsigns').setup()
require('guess-indent').setup()
require('ibl').setup() require('ibl').setup()
require('mason').setup() require('mason').setup()
require('mason-lspconfig').setup() require('mason-lspconfig').setup()
require('nvim-treesitter.configs').setup({highlight = {enable = true}}) require('nvim-treesitter.configs').setup{highlight = {enable = true}}
require('guess-indent').setup()
require('lsp') require('lsp')

View file

@ -3,4 +3,5 @@ autocmd BufReadPost,FileReadPost *.bz3 call gzip#read('bzip3 -rd')
colorscheme dracula colorscheme dracula
command Q q! command Q q!
let b:ale_linters = {'c': [''], 'sh': [''], 'php': ['']} let b:ale_linters = {'c': [''], 'sh': [''], 'php': ['']}
let g:qs_highlight_on_keys = ['f', 'F', 't', 'T']
]] ]]