python configs i think

master
Jordan Orelli 1 week ago
parent f5d1901de7
commit a9c4046bc2

@ -3,13 +3,13 @@ local has_pyright = nil
-- These are files that are typically located in the root directory of a Python
-- project
local root_files = {
'pyproject.toml',
'pyrightconfig.json',
'.git',
'setup.py',
'setup.cfg',
'requirements.txt',
'Pipfile',
'pyrightconfig.json',
'.git',
'pyproject.toml',
}
local buf = vim.api.nvim_get_current_buf()
@ -17,9 +17,11 @@ local buf = vim.api.nvim_get_current_buf()
local root_dir = vim.fs.root(buf, root_files)
local git_dir = vim.fs.root(buf, {'.git'})
local pyright_cmd = {'pyright-langserver', '--stdio'}
local pyright = vim.lsp.start({
name = 'pyright',
cmd = {'pyright-langserver', '--stdio'},
cmd = pyright_cmd,
filetypes = { 'python' },
root_dir = root_dir,
single_file_support = true,

@ -1,2 +1,15 @@
-- yay
-- local rustup_home = os.getenv('RUSTUP_HOME') or util.path.join(user_home, '.rustup')
local etc = require("etc")
local buf = vim.api.nvim_get_current_buf()
local rustup_dir = os.getenv('RUSTUP_HOME') or vim.env.HOME .. '.rustup'
if etc.has_executable("rust-analyzer") then
local rust_analyzer = vim.lsp.start({
name = 'rust-analyzer',
cmd = { 'rust-analyzer' },
filetypes = { 'rust' },
single_file_support = true,
root_dir = vim.fs.root(buf, {'Cargo.toml', '.git'}),
})
vim.lsp.buf_attach_client(buf, rust_analyzer)
end

@ -1,6 +1,9 @@
local signature = require("lsp_signature")
local signature, _ = pcall(function()
return require("lsp_signature")
end);
signature.setup({
if signature then
signature.setup({
-- set to true to enable debug logging
debug = false,
@ -41,11 +44,11 @@ signature.setup({
-- adjust float windows x position.
-- can be either a number or function
floating_window_off_x = -8,
floating_window_off_x = 0,
-- adjust float windows y position. e.g -2 move window up 2 lines; 2 move down 2 lines
-- can be either number or function, see examples
floating_window_off_y = 14,
floating_window_off_y = 0,
-- close floating window after ms when laster parameter is entered
close_timeout = 4000,
@ -127,4 +130,5 @@ signature.setup({
-- e.g. keymaps = { 'j', '<C-o>j' } this map j to <C-o>j in floating window
-- <M-d> and <M-u> are default keymaps to move cursor up and down
keymaps = {}
})
})
end

@ -15,3 +15,5 @@ telescope.setup({
}
},
})
-- builtin.lsp_references

@ -1,6 +1,7 @@
local M = {}
local telescope = require("telescope.builtin")
local path = require("etc.path")
-- cache directory checks for great speed
local work_tree_lookup_cache = {}
@ -28,4 +29,8 @@ M.project_files = function()
end
end
M.has_executable = function(exe_name)
return vim.fn.executable(exe_name) == 1
end
return M

@ -5,6 +5,8 @@ vim.keymap.set('n', '<F2>', telescope.diagnostics, {})
vim.keymap.set('n', '<leader>o', telescope.buffers, {})
vim.keymap.set('n', '<C-k>', vim.cmd.bnext, {})
vim.keymap.set('n', '<C-j>', vim.cmd.bprev, {})
-- vim.keymap.set('n', '<leader>r', vim.lsp.buf.references, {})
vim.keymap.set('n', '<leader>r', telescope.lsp_references, {})
-- vim.keymap.set("v", "J", ":m '>+1<CR>gv=gv")
-- vim.keymap.set("v", "K", ":m '>-2<CR>gv=gv")

@ -52,7 +52,7 @@ function load_plugins(use)
"lewis6991/gitsigns.nvim"
}
use { "ray-x/lsp_signature.nvim" }
-- use { "ray-x/lsp_signature.nvim" }
use { "ervandew/supertab" }
-- a file browser

Loading…
Cancel
Save