From a815f31519cbdd47b559485ba2a72072166759ab Mon Sep 17 00:00:00 2001 From: Josh Rahm Date: Tue, 9 Jul 2024 17:30:14 +0000 Subject: Minor changes --- init.vim | 24 ++++++++++++++++++++++-- lua/lsp.lua | 4 +++- 2 files changed, 25 insertions(+), 3 deletions(-) diff --git a/init.vim b/init.vim index 94031ad..8126339 100644 --- a/init.vim +++ b/init.vim @@ -44,7 +44,6 @@ Plug 'nvim-telescope/telescope.nvim' Plug 'nvim-tree/nvim-tree.lua' Plug 'nvim-treesitter/nvim-treesitter', {'do': ':TSUpdate'} Plug 'nvim-treesitter/nvim-treesitter-textobjects' -Plug 'nvim-treesitter/playground' Plug 'onsails/lspkind.nvim' " Plug 'tpope/vim-surround' Plug 'kylechui/nvim-surround' @@ -72,6 +71,7 @@ set number set relativenumber set pumheight=20 set updatetime=1000 +set matchpairs+=<:> let mapleader=" " @@ -117,7 +117,7 @@ noremap t TroubleToggle augroup InitVim au! - autocmd BufRead *.java,*.c,*.cpp,*.cxx,*.hs TSBufEnable highlight + autocmd BufRead *.java,*.c,*.cpp,*.cxx,*.hs,*.ts TSBufEnable highlight " Automatically stop highligting things when leaving insert mode. If I want " the highlight back, I can just hit 'n' and it will come back. @@ -248,6 +248,26 @@ augroup END let g:jq_highlight_objects = 1 let g:jq_highlight_function_calls = 1 +" Increment the character under the cursor to the next character in order. +function! OrdNext() + let char = matchstr(getline('.'), '\%' . col('.') . 'c.') + let nr = char2nr(char) + let new_char = nr2char(nr + 1) + exec "norm r" . new_char +endfunction + +" Decrement the character under the cursor to the last character in order. +function! OrdPrev() + let char = matchstr(getline('.'), '\%' . col('.') . 'c.') + let nr = char2nr(char) + let new_char = nr2char(nr - 1) + exec "norm r" . new_char +endfunction + +noremap α call OrdNext() +" Capital alpha (α) +noremap Α call OrdPrev() + lua << EOF function open_terminal_on_directory() diff --git a/lua/lsp.lua b/lua/lsp.lua index 6684c80..47eb97e 100644 --- a/lua/lsp.lua +++ b/lua/lsp.lua @@ -3,7 +3,9 @@ local vim = assert(vim) local nvim_lsp = require("lspconfig") nvim_lsp.bashls.setup {} -nvim_lsp.clangd.setup {} +nvim_lsp.clangd.setup { + filetypes = { 'c', 'cpp', 'objc', 'objcpp', 'cuda' }, +} nvim_lsp.jqls.setup {} nvim_lsp.lua_ls.setup {} nvim_lsp.ocamllsp.setup {} -- cgit