Giter VIP home page Giter VIP logo

rust_dev_neovide_nvimsetting's Introduction

Link

rust1 ferris
nvim vim



rust_dev_neovide_LunarVimSetting(My Setting)_GY_Version[🔝]


Dash는 맥용은 유료앱(1년 정기 구독으로 유료임 ㅠㅠ)[🔝]

무료는 DevDocs 웹용이 있음[🔝]


RustSnippet기본 위치[🔝]

~/.vsnip                                                                                          at 19:17:08
❯ tree
.
├── global.json
└── rust.json

0 directories, 2 files

Rust Snippets 정리중[🔝]

요즘 쓰는 LspInlayHint Color Setting[🔝]

  • inlayhint 색깔 hex color (LunarVim Inlayhint Color Settings)
// 요즘 쓰는 색 240106
:hi LspInlayHint guifg=#35638f guibg=#420517
:hi Comment guifg=#35638f guibg=#420517

// 배경은 어두운 빨간색 /  글씨는 약간 밝은 색
:hi Comment guifg=#8aaecf guibg=#4e1a1a

Clangd_extension 추가 기능&Clangd_InlayHint 활성화[🔝]

  • clangd inlayhintsetting로드 하면 글씨 전에 해줘야함. 자동으로 안되네 ㅠㅠ
:lua require("clangd_extensions.inlay_hints").set_inlay_hints()
:ClangdAST 

https://github.com/p00f/clangd_extensions.nvim

  • :ClangdSymbolInfo with the cursor at the desired symbol.
:ClangdSymbolInfo
  • :ClangdTypeHierarchy with the cursor over the desired type or a symbol of that type. gd with the cursor over a type in a window to go to its definition.
:ClangdTypeHierarchy
  • :ClangdMemoryUsage. Preamble can be large so it is collapsed by default, to expand it use :ClangdMemoryUsage expand_preamble
:ClangdMemoryUsage

:ClangdMemoryUsage expand_preamble

라인 fold unfold 접기 / 닫기 / 전체 열기/ 전체 닫기[🔝]

  • zR 접힌거 다 열기Open

  • zM 열린거 다 (접기)닫기Close

  • zo 지금 줄만 (접기)열기Open

  • zc 열린거_(닫기)Close

  • zf 명령어는 무엇일까? 기본적으로 z 명령어는 세가지가 있다. 만들기, 열기, 닫기

  • 일단 fold를 한 번 만들어 놓으면 zo, zc로 여닫을 수 있다.

zf    "F-old 만들기 (만들면서 자동으로 닫는다)
zo    "O-pen fold (열기)
zc    "C-lose fold (닫기)

https://seulcode.tistory.com/488

Hack Nerd Mono Font 설치[🔝]

Tabby AI 설치[🔝]

curl -fsSL https://nvidia.github.io/libnvidia-container/gpgkey |sudo gpg --dearmor -o /usr/share/keyrings/nvidia-container-toolkit-keyring.gpg \
&& curl -s -L https://nvidia.github.io/libnvidia-container/stable/deb/nvidia-container-toolkit.list | sed 's#deb https://#deb [signed-by=/usr/share/keyrings/nvidia-container-toolkit-keyring.gpg] https://#g' | sudo tee /etc/apt/sources.list.d/nvidia-container-toolkit.list \
&& sudo apt-get update
    1. Install the NVIDIA Container Toolkit packages:
sudo apt-get install -y nvidia-container-toolkit
  • 3.Configure the container runtime by using the nvidia-ctk command:
sudo nvidia-ctk runtime configure --runtime=docker
    1. Restart the Docker daemon:
sudo systemctl restart docker
  • tabby (Docker Install)
sudo docker run -it --gpus all -p 8080:8080 -v $HOME/.tabby:/data \
        tabbyml/tabby \
        serve --model TabbyML/StarCoder-3B --device cuda
  • token setting
$ ~/.tabby-client 
❯ eza --icons -TL2
 .
└──  agent
   ├──  config.toml
   └──  data.json
  • config.toml
## Tabby agent configuration file

## Online documentation: https://tabby.tabbyml.com/docs/extensions/configurations
## You can uncomment and edit the values below to change the default settings.
## Configurations in this file have lower priority than the IDE settings.

## Server
## You can set the server endpoint here and an optional authentication token if required.
[server]
endpoint = "http://localhost:8080" # http or https URL
token = "Input My token" # if token is set, request header Authorization = "Bearer $token" will be added automatically

## You can add custom request headers.
# [server.requestHeaders]
# Header1 = "Value1" # list your custom headers here
# Header2 = "Value2" # values can be strings, numbers or booleans

## Logs
## You can set the log level here. The log file is located at ~/.tabby-client/agent/logs/.
# [logs]
# level = "silent" # "silent" or "error" or "debug"

## Anonymous usage tracking
## Tabby collects anonymous usage data and sends it to the Tabby team to help improve our products.
## Your code, generated completions, or any sensitive information is never tracked or sent.
## For more details on data collection, see https://tabby.tabbyml.com/docs/extensions/configurations#usage-collection
## Your contribution is greatly appreciated. However, if you prefer not to participate, you can disable anonymous usage tracking here.
# [anonymousUsageTracking]
# disable = false # set to true to disable
  • http://localhost:8080/ 크롬이나 파이어폭스 브라우져에서 주소창에 치면 DashBoard나온다.

네오빔 플러그인 정리(NeoVim Plugins[🔝]

Theme테마 변경하기[🔝]

  • ./lua/theme.lua
-- vim.cmd("colorscheme OceanicNext")
-- vim.cmd("colorscheme gruvbox")
-- vim.cmd("colorscheme dracura")
-- vim.cmd("colorscheme habamax")
vim.cmd("colorscheme tokyonight-night")

Keymap[🔝]

vim.g.mapleader = " "

-- Disable Ctrl +Z
nnoremap("<C-z>", [[<nop>]])
-- Quick Replace of Word
-- nnoremap("S", [[:%s//g<Left><Left>]])
nnoremap("<leader>rnn", [[:%s//gc<Left><Left><Left>]])

nnoremap(",<leader>", [[:set hlsearch!<CR>]])
-- SymbolOutline
nnoremap("<leader>o", ":SymbolsOutline<CR>")
-- TroubleToggle
nnoremap("<leader>t", ":TroubleToggle<CR>")
nnoremap("<leader>e", ":NvimTreeToggle<CR>")

-- buffer bn bn
nnoremap("H", ":bp<CR>")
nnoremap("L", ":bn<CR>")
-- Disable Q
-- nnoremap([[<silent> Q]], [[nop]])
-- (vs, sp 이거 했을때)지금 창을 큰창으로 만들기 only
nnoremap("<leader>bo", ":on<CR>")

-- Better tabbing
vnoremap("<", "<gv")
vnoremap(">", ">gv")
-- Terminal(Toggleterm)
nnoremap("<C-t>t", ":ToggleTerm direction=float<CR>")
nnoremap("<C-t>tv", ":ToggleTerm direction=vertical<CR>")
-- MoveLine Up & Down
vnoremap("J", ":m '>+1<CR>gv=gv")
vnoremap("K", ":m '<-2<CR>gv=gv")

-- Map Ctrl-W to delete the previous word in insert mode.
inoremap("<C-w>", "<C-\\><C-o>dB")
inoremap("jk", "<esc>")

-- Esc and Clear Highligh
nnoremap("<esc>", ":noh<return><esc>")

-- Yank Whole Line(:%y 전체복사  , 전체 지우기 :%d)
nnoremap("Y", "y$<CR>")

-- Buffer
nnoremap([[<leader>bt]],[[:tabnew<cr>]])
nnoremap([[<leader>btt]],[[:terminal<cr>]])
nnoremap([[,qt]],[[:tabonly<cr>]])
nnoremap([[<leader>q]],[[:tabclose<cr>]])

-- Previous
nnoremap([[bp]], [[:bprevious<CR>]])
-- Next
nnoremap([[bn]], [[:bnext<CR>]])
-- List
nnoremap([[bl]], [[:ls<CR>]])
-- Delete
nnoremap([[bd]], [[:bp <BAR> bd #<CR>]])

-- Delete all buffers except Currenly Open
nnoremap([[bq]],[[:w <bar> %bd <bar> e# <bar> bd# <CR>]])

-- TAB in normal mode will move to text buffer
nnoremap("<TAB>", ":bnext<CR>")
-- SHIFT-TAB will go back
nnoremap("<S-TAB>", ":bprevious<CR>")

-- windows split
nnoremap("vsp", ":vsplit<CR>")
nnoremap("sp", ":split<CR>")



-- Resize Panes with + - or with shift + -
nnoremap("__", ":resize -5<CR>")
nnoremap("++", ":resize +5<CR>")
nnoremap("--", ":vertical resize -5<CR>")
nnoremap("==", ":vertical resize +5<CR>")


-- Crates
nnoremap([[<leader>ct]], [[:lua require('crates').toggle()<cr>]])
nnoremap([[<leader>cr]], [[:lua require('crates').reload()<cr>]])
nnoremap([[<leader>cv]], [[:lua require('crates').show_versions_popup()<cr>]])
nnoremap([[<leader>cf]], [[:lua require('crates').show_features_popup()<cr>]])
nnoremap([[<leader>cu]], [[:lua require('crates').update_crate()<cr>]])
vnoremap([[<leader>cu]], [[:lua require('crates').update_crates()<cr>]])
nnoremap([[<leader>ca]], [[:lua require('crates').update_all_crates()<cr>]])
nnoremap([[<leader>cU]], [[:lua require('crates').upgrade_crate()<cr>]])
vnoremap([[<leader>cU]], [[:lua require('crates').upgrade_crates()<cr>]])
nnoremap([[<leader>cA]], [[:lua require('crates').upgrade_all_crates()<cr>]])


-- cmp관련
  mapping = {
    ["<C-d>"] = cmp.mapping.scroll_docs(-4),
    ["<C-u>"] = cmp.mapping.scroll_docs(4),
    ["<C-Space>"] = cmp.mapping.complete(),
    ["<C-e>"] = cmp.mapping.close(),
    ["<CR>"] = cmp.mapping.confirm({ select = true }),
    ["<C-y>"] = cmp.mapping.confirm({ select = true }),
    ["<Tab>"] = cmp.mapping(cmp.mapping.select_next_item(), { "i", "s" }),
    ["<C-n>"] = cmp.mapping(cmp.mapping.select_next_item(), { "i", "s" }),
    ["<S-Tab>"] = cmp.mapping(cmp.mapping.select_prev_item(), { "i", "s" }),
    ["<C-p>"] = cmp.mapping(cmp.mapping.select_prev_item(), { "i", "s" }),
  },
  sources = {
    { name = "nvim_lsp" },
    { name = "vsnip" },
    { name = "buffer" },
    { name = 'path' },
    { name = 'cmdline' }
  },

HopChar KeyMap[🔝]

  • gw 는 helix키와 똑같음 ㅋ
nnoremap("<backspace>f", [[:HopChar1<CR>]])
nnoremap("gw", [[:HopChar2<CR>]])
nnoremap("<leader>W", [[:HopWord<CR>]])

Telescope KeyMap[🔝]

-- lvim
lvim.keys.normal_mode["<leader><leader>"] = ":Telescope buffers<CR>"


-- nvim setting

nnoremap([[<leader>f]], [[<cmd>Telescope current_buffer_fuzzy_find<CR>]])
nnoremap([[<leader><leader>]], [[<cmd>lua require('telescope.builtin').buffers()<cr>]])
nnoremap("<leader>p", [[:lua require("utils/telescope-config").project_files()<CR>]], true)
nnoremap("<leader>a", ":Telescope lsp_code_actions<CR>", true)
nnoremap("<leader>m", ":Telescope marks<CR>", true)
nnoremap("<leader>i", ":Telescope lsp_implementations<CR>", true)
nnoremap([[<leader>eo]], [[<cmd>lua require('telescope.builtin').oldfiles()<cr>]])
nnoremap([[<leader>S]], [[:Telescope lsp_dynamic_workspace_symbols<CR>]], true)
nnoremap([[<leader>u]], [[:Telescope lsp_references<CR>]], true)
nnoremap([[<leader>s]], [[:Telescope treesitter<CR>]], true)

LSP keymap[🔝]

# LSP
-- Default LSP Keybindings
nnoremap("ga", "<cmd>lua vim.lsp.buf.code_action()<CR>", true)
nnoremap("gd", "<cmd>lua vim.lsp.buf.definition()<CR>", true)
nnoremap("gD", "<cmd>lua vim.lsp.buf.declaration()<CR>", true)
nnoremap("gr", "<cmd>lua vim.lsp.buf.references()<CR>", true)
nnoremap("gi", "<cmd>lua vim.lsp.buf.implementation()<CR>", true)
nnoremap("gh", "<cmd>lua vim.lsp.buf.signature_help()<CR>", true)
nnoremap("gs", "<cmd>lua vim.lsp.buf.workspace_symbol()<CR>", true)
nnoremap("go", "<cmd>lua vim.lsp.buf.document_symbol()<CR>", true)
nnoremap("g[", "<cmd>lua vim.lsp.diagnostic.goto_prev()<CR>", true)
nnoremap("g]", "<cmd>lua vim.lsp.diagnostic.goto_next()<CR>", true)
nnoremap("<leader>rn", "<cmd>lua vim.lsp.buf.rename()<CR>", true)
nnoremap("<leader>wa", "<cmd>lua vim.lsp.buf.add_workspace_folder()<CR>", true)
nnoremap("<leader>wr", "<cmd>lua vim.lsp.buf.remove_workspace_folder()<CR>", true)
nnoremap("<leader>wl", "<cmd>lua print(vim.inspect(vim.lsp.buf.list_workspace_folders()))<CR>", true)

-- Quick Way to Trigger Code Action
nnoremap(",,", "<cmd>lua vim.lsp.buf.code_action()<CR>", true)
-- Press Twice to Enter Vim Buffer of the Hover Definition
nnoremap("K", "<cmd>lua vim.lsp.buf.hover()<CR>", true)
-- Trigger Format

Symbol-outline Keymap[🔝]

keymaps = { -- These keymaps can be a string or a table for multiple keys
    close = {"<Esc>", "q"},
    goto_location = "<Cr>",
    focus_location = "o",
    hover_symbol = "<C-space>",
    toggle_preview = "K",
    rename_symbol = "r",
    code_actions = "a",
    fold = "h",
    unfold = "l",
    fold_all = "W",
    unfold_all = "E",
    fold_reset = "R",
  },

Tabby Keybinding Accept[🔝]

vim.g.tabby_keybinding_accept = '<C-b>'

Spell Check[🔝]

  • spell check에 추가하기
    • 경로명 (.config/nvim/spell/en.utf-8.add)
:spell {word}
❯ tree -L 2
.
├── config.toml
├── init.lua
├── lua
│   ├── autocmd
│   ├── autocmd.lua
│   ├── globals.lua
│   ├── keymaps
│   ├── mappings.lua
│   ├── packages.lua
│   ├── plugins
│   ├── settings.lua
│   ├── theme.lua
│   ├── utils
│   └── vim_g.lua
├── luarc.lua
├── plugin
│   └── packer_compiled.lua
├── readme.md
├── spell
│   ├── en.utf-8.add
│   └── en.utf-8.add.spl
└── stylua.toml

 7 directories, 15 files

packer[🔝]

https://github.com/wbthomason/packer.nvim

LSP Setting[🔝]

:set ft=nasm  " assembly highlight syntax
  • NeoVim(asm-lsp)
    • TSInstall로 Syntax Highlight적용(NeoVim)
:TSInstall asm
cargo install asm-lsp
# or to get the latest version from github
cargo install --git https://github.com/bergercookie/asm-lsp

해결해야할것정리_해결한거랑 해결 못한거[🔝]

:lua vim.diagnostic.goto_next() or :lua vim.diagnostic.goto_prev()
  • rainbow 나왔다가 안 나왔다가 ㅠㅠ 해결 된듯.
:lua require('rainbow-delimiters.setup').setup()
require("plugins/rainbow-delimiters")
require('rainbow-delimiters.setup').setup()
require('rainbow-delimiters.setup').setup ()
-- This module contains a number of default definitions
local rainbow_delimiters = require 'rainbow-delimiters'

---@type rainbow_delimiters.config
vim.g.rainbow_delimiters = {
    strategy = {
        [''] = rainbow_delimiters.strategy['global'],
        vim = rainbow_delimiters.strategy['local'],
    },
    query = {
        [''] = 'rainbow-delimiters',
        lua = 'rainbow-blocks',
    },
    priority = {
        [''] = 110,
        lua = 210,
    },
    highlight = {
        'RainbowDelimiterRed',
        'RainbowDelimiterYellow',
        'RainbowDelimiterBlue',
        'RainbowDelimiterOrange',
        'RainbowDelimiterGreen',
        'RainbowDelimiterViolet',
        'RainbowDelimiterCyan',
    },
}

Undo & Swap file 설정하기[🔝]

-- Enable swap, backup, and persistant undo
vim.opt.directory = SWAPDIR
vim.opt.backupdir = BACKUPDIR
vim.opt.undodir = UNDODIR
vim.opt.swapfile = true
vim.opt.backup = true
vim.opt.undofile = true

-- Append backup files with timestamp
vim.api.nvim_create_autocmd("BufWritePre", {
	callback = function()
		local extension = "~" .. vim.fn.strftime("%Y-%m-%d-%H%M%S")
		vim.o.backupext = extension
	end,
})

  • Lua config for Neovim
    • Capture the current USER and store in variable.
    • Capture the current GROUP by running a system command id -ng
USER = os.getenv("USER")
local curr_group = vim.fn.system("id -ng 2> /dev/null | tr -d '\n'")
  • Use the variables above to assign some dynamically generated directories, based on your current group
SWAPDIR = "/home/" .. curr_group .. "/" .. USER .. "/nvim/swap//"
BACKUPDIR = "/home/" .. curr_group .. "/" .. USER .. "/nvim/backup//"
UNDODIR = "/home/" .. curr_group .. "/" .. USER .. "/nvim/undo//"
  • If the dirs do not exist, create them
    • Update their permissions to 700
if vim.fn.isdirectory(SWAPDIR) == 0 then
	vim.fn.mkdir(SWAPDIR, "p", "0o700")
end

if vim.fn.isdirectory(BACKUPDIR) == 0 then
	vim.fn.mkdir(BACKUPDIR, "p", "0o700")
end

if vim.fn.isdirectory(UNDODIR) == 0 then
	vim.fn.mkdir(UNDODIR, "p", "0o700")
end

Deprecated 해결해야할것 ㅠㅠ[🔝]

vim.lsp.util.parse_snippet() is deprecated. :help deprecated
Feature will be removed in Nvim 0.11
stack traceback:
        ...ies/nvim-linux64/share/nvim/runtime/lua/vim/lsp/util.lua:624: in function 'parse_snippet'
        /home/gy/.config/nvim/lua/plugins/cmp.lua:25: in function 'before'
        ...site/pack/packer/start/lspkind-nvim/lua/lspkind/init.lua:190: in function 'format'
        ...e/nvim/site/pack/packer/start/nvim-cmp/lua/cmp/entry.lua:295: in function 'callback'
        .../site/pack/packer/start/nvim-cmp/lua/cmp/utils/cache.lua:38: in function 'get_vim_item'
        ...e/nvim/site/pack/packer/start/nvim-cmp/lua/cmp/entry.lua:411: in function 'callback'
        .../site/pack/packer/start/nvim-cmp/lua/cmp/utils/cache.lua:38: in function 'match'
        .../nvim/site/pack/packer/start/nvim-cmp/lua/cmp/source.lua:116: in function 'get_entries'
        ...re/nvim/site/pack/packer/start/nvim-cmp/lua/cmp/view.lua:75: in function 'open'
        ...re/nvim/site/pack/packer/start/nvim-cmp/lua/cmp/core.lua:336: in function <...re/nvim/site/pack/packer/start/nvim-cmp/lua/cmp/core.lua:309>
  • 오류가 더 늘어남
gitsigns: Ignoring invalid configuration field 'yadm'
'signs.add.hl' is now deprecated, please define highlight 'GitSignsAdd' e.g:
  vim.api.nvim_set_hl(0, 'GitSignsAdd', { link = 'GitSignsAdd' })
'signs.add.linehl' is now deprecated, please define highlight 'GitSignsAddLn' e.g:
  vim.api.nvim_set_hl(0, 'GitSignsAddLn', { link = 'GitSignsAddLn' })
'signs.add.numhl' is now deprecated, please define highlight 'GitSignsAddNr' e.g:
  vim.api.nvim_set_hl(0, 'GitSignsAddNr', { link = 'GitSignsAddNr' })
'signs.change.hl' is now deprecated, please define highlight 'GitSignsChange' e.g:
  vim.api.nvim_set_hl(0, 'GitSignsChange', { link = 'GitSignsChange' })
'signs.change.linehl' is now deprecated, please define highlight 'GitSignsChangeLn' e.g:
  vim.api.nvim_set_hl(0, 'GitSignsChangeLn', { link = 'GitSignsChangeLn' })
'signs.change.numhl' is now deprecated, please define highlight 'GitSignsChangeNr' e.g:
  vim.api.nvim_set_hl(0, 'GitSignsChangeNr', { link = 'GitSignsChangeNr' })
'signs.changedelete.hl' is now deprecated, please define highlight 'GitSignsChangedelete' e.g:
  vim.api.nvim_set_hl(0, 'GitSignsChangedelete', { link = 'GitSignsChange' })
'signs.changedelete.linehl' is now deprecated, please define highlight 'GitSignsChangedeleteLn' e.g:
  vim.api.nvim_set_hl(0, 'GitSignsChangedeleteLn', { link = 'GitSignsChangeLn' })
'signs.changedelete.numhl' is now deprecated, please define highlight 'GitSignsChangedeleteNr' e.g:
  vim.api.nvim_set_hl(0, 'GitSignsChangedeleteNr', { link = 'GitSignsChangeNr' })
'signs.delete.hl' is now deprecated, please define highlight 'GitSignsDelete' e.g:
  vim.api.nvim_set_hl(0, 'GitSignsDelete', { link = 'GitSignsDelete' })
'signs.delete.linehl' is now deprecated, please define highlight 'GitSignsDeleteLn' e.g:
  vim.api.nvim_set_hl(0, 'GitSignsDeleteLn', { link = 'GitSignsDeleteLn' })
'signs.delete.numhl' is now deprecated, please define highlight 'GitSignsDeleteNr' e.g:
  vim.api.nvim_set_hl(0, 'GitSignsDeleteNr', { link = 'GitSignsDeleteNr' })
'signs.topdelete.hl' is now deprecated, please define highlight 'GitSignsTopdelete' e.g:
  vim.api.nvim_set_hl(0, 'GitSignsTopdelete', { link = 'GitSignsDelete' })
'signs.topdelete.linehl' is now deprecated, please define highlight 'GitSignsTopdeleteLn' e.g:
  vim.api.nvim_set_hl(0, 'GitSignsTopdeleteLn', { link = 'GitSignsDeleteLn' })
-- More --

Source 외국분 git에서 대부분 가져옴[🔝]

다른 외국인의 멋진 NeoVim세팅[🔝]

rust_dev_neovide_nvimsetting's People

Contributors

younghakim7 avatar

Stargazers

Dok6n avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.