status
type
date
slug
summary
tags
category
icon
password
用vim 以及配置terminal 最主要就是想代码敲得快一点
然后确实不用鼠标会更专注在代码上一些
wsl上配置 zsh + oh-my-zsh
需要把path全部搬过来 发现conda用不了 需要先手动把conda加到path
然后
conda init zsh
在zsh里面NeoVIm 配置
注意一下nvim的全部配置一般在init.lua(或init.vim) 二选一 里面
我看一般人都用lua 而且都觉得他方便
A file containing initialization commands is generically called a "vimrc" or config file. It can be either Vimscript ("init.vim") or Lua ("init.lua"), but not both.
这边建议用一个初始模板 很多模板有很多功能 需要慢慢摸索
很多人建议选初始插件少的 慢慢需要再加 也有人觉得一开始就要适应很多功能快捷键
这里选一个kickstart 先探索一下
"${XDG_CONFIG_HOME:-$HOME/.config}"/nvim
LSP 配置
这部分碰到了挺多问题 但是总结下来其实就是node npm要安装好
我最后重新装了一遍node就可以识别了 之前一直错误识别成了node.exe
如果有报错没关系 问一下gpt把之前安错的包卸掉就好
把node配置好确定版本是前置 之后按照https://github.com/neovim/nvim-lspconfig
安装lspconfig 然后用npm安装pyright(或者是别的) 加到init.lua
过程中可以多看看
:LspInfo
看看server path 有没有问题所以说是先装nvim插件 也就是这个 lsp nvim-config 他负责连接nvim 与 我们另外安装的lsp server
- LSP Server:
A language server is a separate process that provides advanced language features—such as auto-completion, go-to-definition, code navigation, diagnostics, and formatting—by analyzing your source code. It implements the Language Server Protocol (LSP), allowing different editors to communicate with it in a standardized way.
- LSP Config (e.g., lspconfig in Neovim):
LSP config is a plugin or configuration layer that simplifies the process of setting up and integrating LSP servers into your editor. It helps you specify settings like root markers, initialization options, and custom commands, enabling seamless interaction between your editor and the language server.
这里只是简单配置 之后有什么问题再说
如果不用这种安装 也可以试试https://lsp-zero.netlify.app/docs/getting-started.html
这里还说需要root marker
具体怎么做还在看 但是single-file 应该也是支持的
而且看
:LspInfo
他也默认把文件所处文件夹当作root了此外 vim中
:cd dir
用来切换working dir
如果使用conda env 那么应该pyright可以自动识别python interpreter
我一开始以为不行 还以为问题出在root dir没有申明 但是也有这么做的
clipboard 配置
可以用
:help clipboard
查看 wsl的配置(使用系统的clipboard) 在 init.lua 里面加
一般在linux中 init.lua加
然后在我这里会报错 undefined global unnamedplus…
这个还挺复杂的 现在ctrl v 和 p 的内容也不同 我就先用着ctrl v
但是这样会妨碍到 visual block?
ok 那么一个解决方法就是 用ctrl-q
那么一个comment技巧就是 ctrl-q 批量选中 + 移动光标(可以加入类似GG ) 然后 shift-i(应该在选中的第一行开始insert) → # → esc (网上说esc *2 但是按一次好像就行了)
这样在选中所有行 句首加入#
然后取消注释用 ctrl-q → 选中目标行 → x 删掉注释
to
You can visual block select before "W" and hit Shift+i - Type "Cool" - Hit ESC and then delete "World" by visual block selection .
Alternatively, the cooler way to do it is to just visual block select "World" in both lines. Type c for
change
. Now you are in the insert
mode. Insert the stuff you want and hit ESC. Both gets reflected with lesser keystrokes.- Author:ran2323
- URL:https://www.blueif.me//article/19971a79-6e22-80b3-9adc-ee3d65b44b49
- Copyright:All articles in this blog, except for special statements, adopt BY-NC-SA agreement. Please indicate the source!