Skip to content

summeriver13/nvim

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

nvim

nvim config for myself.

environment

Windows11, WSL2, Debain.

requirements

Please make sure that your network environment is normal,especially that you can access Github.

quick start

Enter your .config directory.

cd ~/.config

Clone config file.

git clone https://gitee.com/summeriver13/nvim.git

Open any file with nvim. Than waitting for plugin manager download plugins.

nvim nvim/init.nvim

Finshed.

struct

# ~/.config/nvim
.
├── init.lua
├── lua
│   ├── core
│   ├── kits
│   └── plugins
└── README.md

init.lua

import core,kits,plugins.

require("core.options")
require("core.keymaps")

require("kits.plugin-manager")      -- plugin manager 插件管理器
require("kits.theme.tokyonight")    -- theme 主题 
require("kits.line")                -- line 状态栏
require("kits.buffer")              -- buffer 标签栏
require("kits.tree")                -- tree 文件树
require("kits.lsp")                 -- lsp 语言服务协议
require("kits.cmp")                 -- cmp 代码补全
require("kits.comment")             -- comment 注释
require("kits.autopair")            -- autopair 括号匹配
require("kits.file-search")         -- file search 文件搜索

core

manage nvim basic setting.

options.lua

local opt = vim.opt

-- 行号
opt.relativenumber = true
opt.number = true

-- 缩进
opt.tabstop = 4
opt.shiftwidth = 2
opt.expandtab = true
opt.autoindent = true

-- 防止包裹
opt.wrap = false

-- 光标行
opt.cursorline = true

-- 系统剪贴板
opt.clipboard:append("unnamedplus")

-- 默认新窗口右和下
opt.splitright = true
opt.splitbelow = true

-- 搜索
opt.ignorecase = true
opt.smartcase = true

-- 外观
opt.termguicolors = true
opt.signcolumn = "yes"

keymaps.lua 按键映射

vim.g.mapleader = " "

local keymap = vim.keymap

-- ## Vim模式

-- [insert 插入模式] --
keymap.set("i", "jk", "<ESC>")

-- [view 视觉模式] --
-- 单行或多行移动
keymap.set("v", "J", ":m '>+1<CR>gv=gv")
keymap.set("v", "K", ":m '<-2<CR>gv=gv")

-- [normal 正常模式] --
-- 窗口
keymap.set("n", "<leader>sv", "<C-w>v") -- 水平新增窗口
keymap.set("n", "<leader>sh", "<C-w>h") -- 垂直新增窗口

-- 取消高亮
keymap.set("n", "<leader>nh", ":nohl<CR>")

-- ## Plugin 插件
-- nvim-tree
keymap.set("n", "<leader>t", ":NvimTreeToggle<CR>")

-- 切换buffer
keymap.set("n", "<C-L>", ":bnext<CR>")
keymap.set("n", "<C-H>", ":bprevious<CR>")

kits

manage nvim plugins usage.

.
├── autopair.lua        # 括号匹配
├── buffer.lua          # 标签栏
├── cmp.lua             # 代码补全
├── comment.lua         # 注释
├── file-search.lua     # 文件搜索
├── line.lua            # 状态栏
├── lsp.lua             # LSP
├── plugin-manager.lua  # 插件管理器
├── theme               # 主题
└── tree.lua            # 文件树

theme

Add new theme.lua here.

theme
 └── tokyonight.lua

kits.theme may affect kits.line. Please make sure that line is setting correct when you change theme.

plugins

manage nvim plugins install.

About

summeriver13's nvim-setting

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages