More neovim testing

This commit is contained in:
Andrew R. M. 2024-02-06 18:29:51 -05:00
parent 08713c254f
commit c26f6a6bf5
5 changed files with 78 additions and 3 deletions

3
.gitmodules vendored
View File

@ -49,3 +49,6 @@
[submodule "vim/.vim/nvim-bundle/nvim-lspconfig"] [submodule "vim/.vim/nvim-bundle/nvim-lspconfig"]
path = vim/.vim/nvim-bundle/nvim-lspconfig path = vim/.vim/nvim-bundle/nvim-lspconfig
url = https://github.com/neovim/nvim-lspconfig.git url = https://github.com/neovim/nvim-lspconfig.git
[submodule "vim/.vim/nvim-bundle/indent-blankline"]
path = vim/.vim/nvim-bundle/indent-blankline
url = https://github.com/lukas-reineke/indent-blankline.nvim.git

View File

@ -2,8 +2,78 @@ set runtimepath^=~/.vim runtimepath+=~/.vim/after
let &packpath = &runtimepath let &packpath = &runtimepath
source ~/.vimrc source ~/.vimrc
lua <<EOF
vim.g.mapleader = ','
-- print('Hello from lua')
require'lspconfig'.pylsp.setup{}
require'lspconfig'.solargraph.setup{}
-- Configure the 'indent-blankline' plugin
-- Look at configuring this for rainbow blocks at some point
require('ibl').setup{
enabled = false,
indent = {
char = '|'
}
}
-- Setup LSP bindings
vim.api.nvim_create_autocmd('LspAttach', {
desc = 'LSP actions',
callback = function()
local bufmap = function(mode, lhs, rhs)
local opts = {buffer = true}
vim.keymap.set(mode, lhs, rhs, opts)
end
-- Displays hover information about the symbol under the cursor
bufmap('n', 'K', '<cmd>lua vim.lsp.buf.hover()<cr>')
-- Jump to the definition
bufmap('n', 'gd', '<cmd>lua vim.lsp.buf.definition()<cr>')
-- Jump to declaration
bufmap('n', 'gD', '<cmd>lua vim.lsp.buf.declaration()<cr>')
-- Lists all the implementations for the symbol under the cursor
bufmap('n', 'gi', '<cmd>lua vim.lsp.buf.implementation()<cr>')
-- Jumps to the definition of the type symbol
bufmap('n', 'go', '<cmd>lua vim.lsp.buf.type_definition()<cr>')
-- Lists all the references
bufmap('n', 'gr', '<cmd>lua vim.lsp.buf.references()<cr>')
-- Displays a function's signature information
bufmap('n', 'gs', '<cmd>lua vim.lsp.buf.signature_help()<cr>')
-- Renames all references to the symbol under the cursor
bufmap('n', '<F2>', '<cmd>lua vim.lsp.buf.rename()<cr>')
-- Selects a code action available at the current cursor position
bufmap('n', '<F4>', '<cmd>lua vim.lsp.buf.code_action()<cr>')
-- Show diagnostics in a floating window
bufmap('n', 'gl', '<cmd>lua vim.diagnostic.open_float()<cr>')
-- Move to the previous diagnostic
bufmap('n', '[d', '<cmd>lua vim.diagnostic.goto_prev()<cr>')
-- Move to the next diagnostic
bufmap('n', ']d', '<cmd>lua vim.diagnostic.goto_next()<cr>')
end
})
EOF
nnoremap <leader>ib <cmd>IBLToggle<cr>
" Beginner keybinds for telescope " Beginner keybinds for telescope
nnoremap <leader>ff <cmd>Telescope find_files<cr> nnoremap <leader>ff <cmd>Telescope find_files<cr>
nnoremap <leader>fg <cmd>Telescope live_grep<cr> nnoremap <leader>fg <cmd>Telescope live_grep<cr>
nnoremap <leader>fb <cmd>Telescope buffers<cr> nnoremap <leader>fb <cmd>Telescope buffers<cr>
nnoremap <leader>fh <cmd>Telescope help_tags<cr> nnoremap <leader>fh <cmd>Telescope help_tags<cr>
" lua print('this also works')
command! LuaRuntimePath lua print(vim.inspect(vim.api.nvim_list_runtime_paths()))

@ -0,0 +1 @@
Subproject commit 12e92044d313c54c438bd786d11684c88f6f78cd

View File

@ -6,7 +6,7 @@ set nocompatible
"{- PLUGIN MANAGER -}" "{- PLUGIN MANAGER -}"
" Load pathogen, the plugin manager, which then loads all plugins " " Load pathogen, the plugin manager, which then loads all plugins "
runtime bundle/pathogen/autoload/pathogen.vim runtime bundle/pathogen/autoload/pathogen.vim
execute pathogen#infect() execute pathogen#infect('bundle/{}', 'nvim-bundle/{}')
"{- COMMANDS -}" "{- COMMANDS -}"
@ -31,7 +31,7 @@ set nocompatible
"{- INTERFACE -}" "{- INTERFACE -}"
" Colors and syntax highlighting " " Colors and syntax highlighting "
colorscheme dim colorscheme halfdab
set background=dark set background=dark
filetype plugin on filetype plugin on
syntax on syntax on
@ -103,7 +103,8 @@ set nocompatible
set complete+=kspell set complete+=kspell
" Match the longest completion option then display menu " Match the longest completion option then display menu
set completeopt=menuone,longest "set completeopt=menuone,longest
set completeopt=menu,menuone,noselect
" Use UTF-8 " " Use UTF-8 "
set encoding=utf-8 set encoding=utf-8