mirror of
https://github.com/jdhao/nvim-config.git
synced 2025-06-08 14:14:33 +02:00
Compare commits
5 Commits
1608a36dd3
...
v0.9.1
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
4a6379ca5d | ||
|
|
855a88b532 | ||
|
|
892cd49f06 | ||
|
|
e53ee104ec | ||
|
|
671c78df9b |
@@ -42,7 +42,7 @@ let g:Lf_UseMemoryCache = 0
|
|||||||
|
|
||||||
" Ignore certain files and directories when searching files
|
" Ignore certain files and directories when searching files
|
||||||
let g:Lf_WildIgnore = {
|
let g:Lf_WildIgnore = {
|
||||||
\ 'dir': ['.git', '__pycache__', '.DS_Store'],
|
\ 'dir': ['.git', '__pycache__', '.DS_Store', '*_cache'],
|
||||||
\ 'file': ['*.exe', '*.dll', '*.so', '*.o', '*.pyc', '*.jpg', '*.png',
|
\ 'file': ['*.exe', '*.dll', '*.so', '*.o', '*.pyc', '*.jpg', '*.png',
|
||||||
\ '*.gif', '*.svg', '*.ico', '*.db', '*.tgz', '*.tar.gz', '*.gz',
|
\ '*.gif', '*.svg', '*.ico', '*.db', '*.tgz', '*.tar.gz', '*.gz',
|
||||||
\ '*.zip', '*.bin', '*.pptx', '*.xlsx', '*.docx', '*.pdf', '*.tmp',
|
\ '*.zip', '*.bin', '*.pptx', '*.xlsx', '*.docx', '*.pdf', '*.tmp',
|
||||||
|
|||||||
@@ -65,7 +65,7 @@ pip install -U pynvim
|
|||||||
[python-lsp-server (pylsp)](https://github.com/python-lsp/python-lsp-server) is a Python [Language Server](https://microsoft.github.io/language-server-protocol/) for completion, linting, go to definition, etc.
|
[python-lsp-server (pylsp)](https://github.com/python-lsp/python-lsp-server) is a Python [Language Server](https://microsoft.github.io/language-server-protocol/) for completion, linting, go to definition, etc.
|
||||||
|
|
||||||
```
|
```
|
||||||
pip install 'python-lsp-server[all]' pylsp-mypy pyls-isort
|
pip install 'python-lsp-server[all]' pylsp-mypy python-lsp-isort python-lsp-black
|
||||||
```
|
```
|
||||||
|
|
||||||
Note the executable for pylsp is also named `pylsp`. You need to set its PATH correctly.
|
Note the executable for pylsp is also named `pylsp`. You need to set its PATH correctly.
|
||||||
|
|||||||
@@ -68,7 +68,7 @@ fi
|
|||||||
|
|
||||||
# Install some Python packages used by Nvim plugins.
|
# Install some Python packages used by Nvim plugins.
|
||||||
echo "Installing Python packages"
|
echo "Installing Python packages"
|
||||||
declare -a PY_PACKAGES=("pynvim" 'python-lsp-server[all]' "black" "vim-vint" "pyls-isort" "pylsp-mypy")
|
declare -a PY_PACKAGES=("pynvim" 'python-lsp-server[all]' "vim-vint" "python-lsp-isort" "pylsp-mypy" "python-lsp-black")
|
||||||
|
|
||||||
if [[ "$SYSTEM_PYTHON" = true ]]; then
|
if [[ "$SYSTEM_PYTHON" = true ]]; then
|
||||||
echo "Using system Python to install $(PY_PACKAGES)"
|
echo "Using system Python to install $(PY_PACKAGES)"
|
||||||
|
|||||||
@@ -27,7 +27,7 @@ scoop install miniconda3
|
|||||||
pip install -U pynvim
|
pip install -U pynvim
|
||||||
|
|
||||||
# Install python-language-server
|
# Install python-language-server
|
||||||
pip install 'python-lsp-server[all]' pylsp-mypy pyls-isort
|
pip install 'python-lsp-server[all]' pylsp-mypy python-lsp-isort
|
||||||
|
|
||||||
# Install visual c++ redistribution
|
# Install visual c++ redistribution
|
||||||
scoop install vcredist2022
|
scoop install vcredist2022
|
||||||
|
|||||||
10
init.lua
10
init.lua
@@ -36,8 +36,14 @@ local core_conf_files = {
|
|||||||
}
|
}
|
||||||
|
|
||||||
-- source all the core config files
|
-- source all the core config files
|
||||||
for _, name in ipairs(core_conf_files) do
|
for _, file_name in ipairs(core_conf_files) do
|
||||||
local path = string.format("%s/core/%s", vim.fn.stdpath("config"), name)
|
if vim.endswith(file_name, 'vim') then
|
||||||
|
local path = string.format("%s/core/%s", vim.fn.stdpath("config"), file_name)
|
||||||
local source_cmd = "source " .. path
|
local source_cmd = "source " .. path
|
||||||
vim.cmd(source_cmd)
|
vim.cmd(source_cmd)
|
||||||
|
else
|
||||||
|
local module_name, _ = string.gsub(file_name, "%.lua", "")
|
||||||
|
package.loaded[module_name] = nil
|
||||||
|
require(module_name)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -2,24 +2,36 @@ local keymap = vim.keymap
|
|||||||
local gitlinker = require("gitlinker")
|
local gitlinker = require("gitlinker")
|
||||||
|
|
||||||
gitlinker.setup {
|
gitlinker.setup {
|
||||||
|
callbacks = {
|
||||||
|
["dev.azure.com"] = function(url_data)
|
||||||
|
vim.print(url_data)
|
||||||
|
local url = require"gitlinker.hosts".get_base_https_url(url_data)
|
||||||
|
|
||||||
|
if url_data.lstart then
|
||||||
|
if url_data.lend == nil then
|
||||||
|
url_data.lend = url_data.lstart
|
||||||
|
end
|
||||||
|
url = url .. "?path=/" .. url_data.file .. "&version=GC" .. url_data.rev .. "&line=" .. url_data.lstart .. "&lineEnd=" .. url_data.lend .. "&lineStartColumn=1" .. "&lineEndColumn=120"
|
||||||
|
end
|
||||||
|
return url
|
||||||
|
end
|
||||||
|
},
|
||||||
mappings = nil,
|
mappings = nil,
|
||||||
}
|
}
|
||||||
|
|
||||||
keymap.set({ "n", "v" }, "<leader>gl", "", {
|
keymap.set({ "n", "v" }, "<leader>gl", function()
|
||||||
silent = true,
|
|
||||||
desc = "get git permlink",
|
|
||||||
callback = function()
|
|
||||||
local mode = string.lower(vim.fn.mode())
|
local mode = string.lower(vim.fn.mode())
|
||||||
gitlinker.get_buf_range_url(mode)
|
gitlinker.get_buf_range_url(mode)
|
||||||
end,
|
end, {
|
||||||
|
silent = true,
|
||||||
|
desc = "get git permlink",
|
||||||
})
|
})
|
||||||
|
|
||||||
keymap.set("n", "<leader>gb", "", {
|
keymap.set("n", "<leader>gb", function()
|
||||||
silent = true,
|
|
||||||
desc = "browse repo in browser",
|
|
||||||
callback = function()
|
|
||||||
gitlinker.get_repo_url({
|
gitlinker.get_repo_url({
|
||||||
action_callback = gitlinker.actions.open_in_browser
|
action_callback = gitlinker.actions.open_in_browser
|
||||||
})
|
})
|
||||||
end
|
end, {
|
||||||
|
silent = true,
|
||||||
|
desc = "browse repo in browser",
|
||||||
})
|
})
|
||||||
|
|||||||
Reference in New Issue
Block a user