Compare commits

...

4 Commits

Author SHA1 Message Date
09af3f70a1
nvim: make Python LSP also check docstrings 2023-04-12 12:46:43 -04:00
b93a5f4571
nvim: IDE stuff
it's all cool and LSP-ey now wow
2023-04-12 11:20:21 -04:00
fa0fb41707
programs: updated 2023-04-12 11:18:25 -04:00
2b67f24ee0
nvim: split off Lua config files 2023-04-11 20:54:53 -04:00
5 changed files with 126 additions and 29 deletions

View File

@ -1,6 +1,4 @@
xwallpaper
ncmpcpp
mpd
dunst
zathura
xkblayout-state
@ -10,3 +8,29 @@ xorg-xset
xss-lock
qutebrowser
picom
neovim
keepassxc
jq
tmux
dash
fish
fzf
gimp
blender
audacity
pulsemixer
ffmppeg
mpv
netcat
nmap
remmina
yt-dlp
syncthing
inkscape
scrot
pynvim
python-lsp-server
bear
xsel
xwallpaper
xss-lock

View File

@ -162,37 +162,19 @@ Plug 'nvim-treesitter/nvim-treesitter'
Plug 'axieax/urlview.nvim'
Plug 'neovim/nvim-lspconfig'
Plug 'nvim-lua/completion-nvim'
Plug 'nvim-lua/lsp-status.nvim'
Plug 'stevearc/dressing.nvim'
call plug#end()
lua << EOF
require'nvim-treesitter.configs'.setup {
ensure_installed = { "c", "cpp", "javascript", "python", "vim", "latex", "fish", "bash" },
sync_install = false,
auto_install = false,
highlight = {
enable = true,
disable = function(lang, buf)
local max_filesize = 100 * 1024 -- 100 KB
local ok, stats = pcall(vim.loop.fs_stat, vim.api.nvim_buf_get_name(buf))
if ok and stats and stats.size > max_filesize then
return true
end
end,
},
}
EOF
lua << EOF
require("urlview").setup({
jump = {
prev = "<leader>uj",
next = "<leader>uh",
},
})
EOF
" copy URL under cursor to clipboard bind
:nnoremap <silent><leader>uu :let @+ = expand('<cfile>')<CR>
" see .config/nvim/lua/init.lua
lua require('init')
" Code folding
set foldmethod=expr
set foldexpr=nvim_treesitter#foldexpr()

View File

@ -0,0 +1,84 @@
-- Syntax highlighting
require'nvim-treesitter.configs'.setup {
ensure_installed = { "c", "cpp", "javascript", "python", "vim", "latex", "fish", "bash" },
sync_install = false,
auto_install = false,
highlight = {
enable = true,
disable = function(lang, buf)
local max_filesize = 100 * 1024 -- 100 KB
local ok, stats = pcall(vim.loop.fs_stat, vim.api.nvim_buf_get_name(buf))
if ok and stats and stats.size > max_filesize then
return true
end
end,
},
}
-- motions to hop between URLs fast
require("urlview").setup({
jump = {
prev = "<leader>uj",
next = "<leader>uh",
},
})
local nvim_lsp = require('lspconfig')
local on_attach = function(client, bufnr)
local function buf_set_keymap(...) vim.api.nvim_buf_set_keymap(bufnr, ...) end
local function buf_set_option(...) vim.api.nvim_buf_set_option(bufnr, ...) end
-- Enable completion triggered by <c-x><c-o>
buf_set_option('omnifunc', 'v:lua.vim.lsp.omnifunc')
local opts = { noremap=true, silent=true }
buf_set_keymap('n', 'gD', '<cmd>lua vim.lsp.buf.declaration()<CR>', opts)
buf_set_keymap('n', 'gd', '<cmd>lua vim.lsp.buf.definition()<CR>', opts)
buf_set_keymap('n', 'gK', '<cmd>lua vim.lsp.buf.hover()<CR>', opts)
buf_set_keymap('n', 'gi', '<cmd>lua vim.lsp.buf.implementation()<CR>', opts)
buf_set_keymap('n', 'gs', '<cmd>lua vim.lsp.buf.signature_help()<CR>', opts)
buf_set_keymap('n', 'gt', '<cmd>lua vim.lsp.buf.type_definition()<CR>', opts)
buf_set_keymap('n', '<space>rn', '<cmd>lua vim.lsp.buf.rename()<CR>', opts)
buf_set_keymap('n', 'gr', '<cmd>lua vim.lsp.buf.references()<CR>', opts)
buf_set_keymap('n', '<space>e', '<cmd>lua vim.lsp.diagnostic.show_line_diagnostics()<CR>', opts)
buf_set_keymap('n', '[d', '<cmd>lua vim.lsp.diagnostic.goto_prev()<CR>', opts)
buf_set_keymap('n', ']d', '<cmd>lua vim.lsp.diagnostic.goto_next()<CR>', opts)
buf_set_keymap('n', '<space>ca', '<cmd>lua vim.lsp.buf.code_action()<CR>', opts)
end
-- settings per server (overrides defaults)
local servers = {
pylsp = {
settings = {
pylsp = {
plugins = {
pydocstyle = {
enabled = true,
convention = "numpy",
addIgnore = {"D100", "D101", "D102", "D105"}
}
}
}
}
},
clangd = {}
}
for lsp, sv_settings in pairs(servers) do
-- defaults
settings = {
on_attach = on_attach,
flags = {
debounce_text_changes = 150,
}
}
for k, v in pairs(servers) do settings[k] = v end
nvim_lsp[lsp].setup(settings[lsp])
end
-- fancy prompts
require('dressing').setup({
input = {
insert_only = false,
}
})

View File

@ -3,3 +3,7 @@
~/.cache/termdebug/%: %.cpp
mkdir -p ~/.cache/termdebug/
$(LINK.cpp) -g -Wall -Wpedantic $^ $(LOADLIBES) $(LDLIBS) -o $@
~/.cache/termdebug/%: %.c
mkdir -p ~/.cache/termdebug/
$(LINK.c) -g -Wall -Wpedantic $^ $(LOADLIBES) $(LDLIBS) -o $@

3
src/.config/pycodestyle Normal file
View File

@ -0,0 +1,3 @@
[pycodestyle]
ignore = E203
max-line-length = 88