hoschi / yode-nvim

Yode plugin for NeoVim
MIT License
371 stars 3 forks source link

Strange code color #10

Closed crusj closed 2 years ago

crusj commented 2 years ago
图片
hoschi commented 2 years ago

How do other floating windows look? I don't set any highlights inside the floating window.

crusj commented 2 years ago

How do other floating windows look? I don't set any highlights inside the floating window.

图片
hoschi commented 2 years ago

hmmm. Do you have these strange colors on all file types? What color scheme do you use? Can you paste your nvim config?

crusj commented 2 years ago

hmmm. Do you have these strange colors on all file types? What color scheme do you use? Can you paste your nvim config?

I currently tried lua and go file types are like this, my theme is: overcache/neosolarized. I changed to other themes as well, I observed it, it seems that the colors are reversed in yodo

crusj commented 2 years ago

hmmm. Do you have these strange colors on all file types? What color scheme do you use? Can you paste your nvim config?

set ts=4 set shiftwidth=4 set mouse=a set nu set rnu syntax enable language en_US set background=light set nocompatible set clipboard=unnamedplus set backspace=indent,eol,start " colorscheme solarized colorscheme NeoSolarized set cursorline " 高亮当前行 set hidden "opening a new file when the current buffer has unsaved changes causes files to be hidden instead of closed set foldmethod=indent set nofoldenable set signcolumn=yes let mapleader = "\" set shell=/bin/bash " this variable must be enabled for colors to be applied properly set termguicolors set guifont=Hack\ Nerd\ Font

"floaterm start let g:floaterm_keymap_toggle = '\a' let g:floaterm_keymap_next = '\'

"floaterm end

" buffnet start function! g:BuffetSetCustomColors() hi! BuffetCurrentBuffer gui=NONE guibg=#F77F38 guifg=#ffffff hi! BuffetActiveBuffer gui=NONE guibg=#ABABAB guifg=#282a36 hi! BuffetBuffer gui=NONE guibg=#ffffff guifg=#F77F38 hi! BuffetModCurrentBuffer gui=NONE guibg=#ff6600 guifg=#ffffff hi! BuffetModActiveBuffer gui=NONE guibg=#ABABAB guifg=#282a36 hi! BuffetModBuffer gui=NONE guibg=#ffffff guifg=#ff6600 hi! BuffetTrunc gui=NONE guibg=#bd93f9 guifg=#282a36 hi! BuffetTab gui=NONE guibg=#0D4E91 guifg=#ffffff endfunction

noremap :bn noremap :bp nmap 1 BuffetSwitch(1) nmap 2 BuffetSwitch(2) nmap 3 BuffetSwitch(3) nmap 4 BuffetSwitch(4) nmap 5 BuffetSwitch(5) nmap 6 BuffetSwitch(6) nmap 7 BuffetSwitch(7) nmap 8 BuffetSwitch(8) nmap 9 BuffetSwitch(9) " close current buffer nmap \x :Bw " close others buffer nmap \X :Bonly

let g:buffet_tab_icon = "\uf00a" let g:buffet_left_trunc_icon = "\uf0a8" let g:buffet_right_trunc_icon = "\uf0a9" let g:buffet_powerline_separators = 1 let g:buffet_show_index = 1

" buffnet end

"coc start autocmd FileType go nmap gft :CocCommand go.test.generate.function autocmd FileType go nmap gsT :CocCommand go.tags.add autocmd FileType go nmap gst :CocCommand go.tags.add.line nmap [g (coc-diagnostic-prev) nmap ]g (coc-diagnostic-next)

"" snippets " Use for trigger snippet expand. imap (coc-snippets-expand)

" Use for select text for visual placeholder of snippet. vmap (coc-snippets-select)

" Use for jump to next placeholder, it's default of coc.nvim let g:coc_snippet_next = ''

" Use for jump to previous placeholder, it's default of coc.nvim let g:coc_snippet_prev = ''

" Use for both expand and jump (make expand higher priority.) imap (coc-snippets-expand-jump)

" Use x for convert visual selected code to snippet xmap x (coc-convert-snippet) " Use for both expand and jump (make expand higher priority.) imap (coc-snippets-expand-jump) inoremap \ pumvisible() ? coc#_select_confirm() : \ coc#expandableOrJumpable() ? "\=coc#rpc#request('doKeymap', ['snippets-expand-jump',''])\" : \ check_back_space() ? "\" : \ coc#refresh()

function! s:check_back_space() abort let col = col('.') - 1 return !col || getline('.')[col - 1] =~# '\s' endfunction let g:coc_snippet_next = ''

"nmap gi (coc-implementation) " translate text under cursor, use youdao and google nmap \s (coc-translator-p) "coc end

lua require('plugins') lua require('nerd_tree') lua require('lsp_config') lua require('telescope_config') lua require('session_manager_config') lua require('treesitter_config') lua require('lualine').setup({ \options = { \theme = 'solarized_light'
} })

" tagbar start let g:tagbar_map_showproto = '.' let g:tagbar_show_linenumbers = 2 let g:tagbar_type_go = { \ 'ctagstype' : 'go', \ 'kinds' : [ \ 'p:package', \ 'i:imports:1', \ 'c:constants', \ 'v:variables', \ 't:types', \ 'n:interfaces', \ 'w:fields', \ 'e:embedded', \ 'm:methods', \ 'r:constructor', \ 'f:functions' \ ], \ 'sro' : '.', \ 'kind2scope' : { \ 't' : 'ctype', \ 'n' : 'ntype' \ }, \ 'scope2kind' : { \ 'ctype' : 't', \ 'ntype' : 'n' \ }, \ 'ctagsbin' : 'gotags', \ 'ctagsargs' : '-sort -silent' \ } nmap ft :TagbarToggle " tagbar end

"yode start lua require('yode-nvim').setup({}) map yc :YodeCreateSeditorFloating map yr :YodeCreateSeditorReplace nmap bd :YodeBufferDelete imap bd :YodeBufferDelete " these commands fall back to overwritten keys when cursor is in split window map r :YodeLayoutShiftWinDown map R :YodeLayoutShiftWinUp map J :YodeLayoutShiftWinBottom map K :YodeLayoutShiftWinTop " at the moment this is needed to have no gap for floating windows set showtabline=2 "yode end

"map start nnoremap \e :b# inoremap ( ()i inoremap { {}i inoremap { {}0O inoremap [ []i inoremap ' ''i inoremap " ""i nnoremap j h nnoremap k l "map end

"telescope start nnoremap ff lua require('telescope.builtin').find_files() nnoremap fr lua vim.lsp.buf.formatting() nnoremap fg lua require('telescope.builtin').live_grep() nnoremap fb lua require('telescope.builtin').buffers() nnoremap ft lua require('telescope.builtin').tags() nnoremap fp lua require('telescope.builtin').treesitter() nnoremap ga lua require('telescope.builtin').lsp_code_actions() nnoremap gr lua require('telescope.builtin').lsp_references() nnoremap gi lua require('telescope.builtin').lsp_implementations() nnoremap gd lua require('telescope.builtin').lsp_definitions() nnoremap gs lua require('telescope.builtin').lsp_document_symbols() "telescope end

"delv start nnoremap 1 :DlvToggleBreakpoint nnoremap 2 :DlvDebug nnoremap 3 :DlvTest "delv end

"test start let test#strategy = 'floaterm' nnoremap t TestNearest -v "test end

"markdown start "markdown end

"autocmd start autocmd BufWritePre *.go lua vim.lsp.buf.formatting() autocmd User SessionLoadPost lua require"neo-tree".show() "autocmd end

set ts=4 set shiftwidth=4 set mouse=a set nu set rnu syntax enable language en_US set background=light set nocompatible set clipboard=unnamedplus set backspace=indent,eol,start " colorscheme solarized colorscheme NeoSolarized set cursorline " 高亮当前行 set hidden "opening a new file when the current buffer has unsaved changes causes files to be hidden instead of closed set foldmethod=indent set nofoldenable set signcolumn=yes let mapleader = "\" set shell=/bin/bash " this variable must be enabled for colors to be applied properly set termguicolors set guifont=Hack\ Nerd\ Font

"floaterm start let g:floaterm_keymap_toggle = '\a' let g:floaterm_keymap_next = '\'

"floaterm end

" buffnet start function! g:BuffetSetCustomColors() hi! BuffetCurrentBuffer gui=NONE guibg=#F77F38 guifg=#ffffff hi! BuffetActiveBuffer gui=NONE guibg=#ABABAB guifg=#282a36 hi! BuffetBuffer gui=NONE guibg=#ffffff guifg=#F77F38 hi! BuffetModCurrentBuffer gui=NONE guibg=#ff6600 guifg=#ffffff hi! BuffetModActiveBuffer gui=NONE guibg=#ABABAB guifg=#282a36 hi! BuffetModBuffer gui=NONE guibg=#ffffff guifg=#ff6600 hi! BuffetTrunc gui=NONE guibg=#bd93f9 guifg=#282a36 hi! BuffetTab gui=NONE guibg=#0D4E91 guifg=#ffffff endfunction

noremap :bn noremap :bp nmap 1 BuffetSwitch(1) nmap 2 BuffetSwitch(2) nmap 3 BuffetSwitch(3) nmap 4 BuffetSwitch(4) nmap 5 BuffetSwitch(5) nmap 6 BuffetSwitch(6) nmap 7 BuffetSwitch(7) nmap 8 BuffetSwitch(8) nmap 9 BuffetSwitch(9) " close current buffer nmap \x :Bw " close others buffer nmap \X :Bonly

let g:buffet_tab_icon = "\uf00a" let g:buffet_left_trunc_icon = "\uf0a8" let g:buffet_right_trunc_icon = "\uf0a9" let g:buffet_powerline_separators = 1 let g:buffet_show_index = 1

" buffnet end

"coc start autocmd FileType go nmap gft :CocCommand go.test.generate.function autocmd FileType go nmap gsT :CocCommand go.tags.add autocmd FileType go nmap gst :CocCommand go.tags.add.line nmap [g (coc-diagnostic-prev) nmap ]g (coc-diagnostic-next)

"" snippets " Use for trigger snippet expand. imap (coc-snippets-expand)

" Use for select text for visual placeholder of snippet. vmap (coc-snippets-select)

" Use for jump to next placeholder, it's default of coc.nvim let g:coc_snippet_next = ''

" Use for jump to previous placeholder, it's default of coc.nvim let g:coc_snippet_prev = ''

" Use for both expand and jump (make expand higher priority.) imap (coc-snippets-expand-jump)

" Use x for convert visual selected code to snippet xmap x (coc-convert-snippet) " Use for both expand and jump (make expand higher priority.) imap (coc-snippets-expand-jump) inoremap \ pumvisible() ? coc#_select_confirm() : \ coc#expandableOrJumpable() ? "\=coc#rpc#request('doKeymap', ['snippets-expand-jump',''])\" : \ check_back_space() ? "\" : \ coc#refresh()

function! s:check_back_space() abort let col = col('.') - 1 return !col || getline('.')[col - 1] =~# '\s' endfunction let g:coc_snippet_next = ''

"nmap gi (coc-implementation) " translate text under cursor, use youdao and google nmap \s (coc-translator-p) "coc end

lua require('plugins') lua require('nerd_tree') lua require('lsp_config') lua require('telescope_config') lua require('session_manager_config') lua require('treesitter_config') lua require('lualine').setup({ \options = { \theme = 'solarized_light'
} })

" tagbar start let g:tagbar_map_showproto = '.' let g:tagbar_show_linenumbers = 2 let g:tagbar_type_go = { \ 'ctagstype' : 'go', \ 'kinds' : [ \ 'p:package', \ 'i:imports:1', \ 'c:constants', \ 'v:variables', \ 't:types', \ 'n:interfaces', \ 'w:fields', \ 'e:embedded', \ 'm:methods', \ 'r:constructor', \ 'f:functions' \ ], \ 'sro' : '.', \ 'kind2scope' : { \ 't' : 'ctype', \ 'n' : 'ntype' \ }, \ 'scope2kind' : { \ 'ctype' : 't', \ 'ntype' : 'n' \ }, \ 'ctagsbin' : 'gotags', \ 'ctagsargs' : '-sort -silent' \ } nmap ft :TagbarToggle " tagbar end

"yode start lua require('yode-nvim').setup({}) map yc :YodeCreateSeditorFloating map yr :YodeCreateSeditorReplace nmap bd :YodeBufferDelete imap bd :YodeBufferDelete " these commands fall back to overwritten keys when cursor is in split window map r :YodeLayoutShiftWinDown map R :YodeLayoutShiftWinUp map J :YodeLayoutShiftWinBottom map K :YodeLayoutShiftWinTop " at the moment this is needed to have no gap for floating windows set showtabline=2 "yode end

"map start nnoremap \e :b# inoremap ( ()i inoremap { {}i inoremap { {}0O inoremap [ []i inoremap ' ''i inoremap " ""i nnoremap j h nnoremap k l "map end

"telescope start nnoremap ff lua require('telescope.builtin').find_files() nnoremap fr lua vim.lsp.buf.formatting() nnoremap fg lua require('telescope.builtin').live_grep() nnoremap fb lua require('telescope.builtin').buffers() nnoremap ft lua require('telescope.builtin').tags() nnoremap fp lua require('telescope.builtin').treesitter() nnoremap ga lua require('telescope.builtin').lsp_code_actions() nnoremap gr lua require('telescope.builtin').lsp_references() nnoremap gi lua require('telescope.builtin').lsp_implementations() nnoremap gd lua require('telescope.builtin').lsp_definitions() nnoremap gs lua require('telescope.builtin').lsp_document_symbols() "telescope end

"delv start nnoremap 1 :DlvToggleBreakpoint nnoremap 2 :DlvDebug nnoremap 3 :DlvTest "delv end

"test start let test#strategy = 'floaterm' nnoremap t TestNearest -v "test end

"markdown start "markdown end

"autocmd start autocmd BufWritePre *.go lua vim.lsp.buf.formatting() autocmd User SessionLoadPost lua require"neo-tree".show() "autocmd end

require'nvim-treesitter.configs'.setup { -- One of "all", "maintained" (parsers with maintainers), or a list of languages ensure_installed = "maintained",

-- Install languages synchronously (only applied to `ensure_installed`)
sync_install = false,

-- List of parsers to ignore installing
ignore_install = { "javascript" },

highlight = {
    -- `false` will disable the whole extension
    enable = true,

    -- NOTE: these are the names of the parsers and not the filetype. (for example if you want to
    -- disable highlighting for the `tex` filetype, you need to include `latex` in this list as this is
    -- the name of the parser)
    -- list of language that will be disabled
    disable = { "c","html"},

    -- Setting this to true will run `:h syntax` and tree-sitter at the same time.
    -- Set this to `true` if you depend on 'syntax' being enabled (like for indentation).
    -- Using this option may slow down your editor, and you may see some duplicate highlights.
    -- Instead of true it can also be a list of languages
    additional_vim_regex_highlighting = false,
},
rainbow = {
    enable = true,
    -- disable = { "jsx", "cpp" }, list of languages you want to disable the plugin for
    extended_mode = true, -- Also highlight non-bracket delimiters like html tags, boolean or table: lang -> boolean
    max_file_lines = nil, -- Do not enable for files with more than n lines, int
    -- colors = {}, -- table of hex strings
    -- termcolors = {} -- table of colour name strings
}

-- This file can be loaded by callinglua require('plugins')` from your init.vim

-- Only required if you have packer configured as opt vim.cmd [[packadd packer.nvim]]

return require('packer').startup(function() -- Packer can manage itself use 'wbthomason/packer.nvim' use 'neovim/nvim-lspconfig' -- collection of configurations for the built-in lsp client use 'kyazdani42/nvim-web-devicons' use 'overcache/neosolarized' use {'neoclide/coc.nvim', branch = 'release'} use 'gfanto/fzf-lsp.nvim' use 'nvim-treesitter/nvim-treesitter' use { 'nvim-lualine/lualine.nvim', requires = { 'kyazdani42/nvim-web-devicons', opt = true } } use 'bagrat/vim-buffet' use 'voldikss/vim-floaterm' use 'nvim-lua/plenary.nvim' use 'hoschi/yode-nvim' use { 'nvim-telescope/telescope.nvim', requires = { {'nvim-lua/plenary.nvim'} }, } use { 'nvim-telescope/telescope-fzf-native.nvim', run = 'make' } use 'preservim/tagbar' use 'vim-test/vim-test' use 'sebdah/vim-delve' use { "nvim-neo-tree/neo-tree.nvim", branch = "v2.x", requires = { "nvim-lua/plenary.nvim", "kyazdani42/nvim-web-devicons", -- not strictly required, but recommended "MunifTanjim/nui.nvim" }, config = function () -- Unless you are still migrating, remove the deprecated commands from v1.x vim.cmd([[ let g:neo_tree_remove_legacy_commands = 1 ]])

      -- If you want icons for diagnostic errors, you'll need to define them somewhere:
      vim.fn.sign_define("DiagnosticSignError",
        {text = " ", texthl = "DiagnosticSignError"})
      vim.fn.sign_define("DiagnosticSignWarn",
        {text = " ", texthl = "DiagnosticSignWarn"})
      vim.fn.sign_define("DiagnosticSignInfo",
        {text = " ", texthl = "DiagnosticSignInfo"})
      vim.fn.sign_define("DiagnosticSignHint",
        {text = "", texthl = "DiagnosticSignHint"})
      -- NOTE: this is changed from v1.x, which used the old style of highlight groups
      -- in the form "LspDiagnosticsSignWarning"
      vim.cmd([[nnoremap \ :Neotree reveal<cr>]])
    end
}

use 'p00f/nvim-ts-rainbow'
use 'Shatur/neovim-session-manager'
use {'nvim-telescope/telescope-ui-select.nvim' }

end) `

crusj commented 2 years ago

hmmm. Do you have these strange colors on all file types? What color scheme do you use? Can you paste your nvim config?

图片

The background color and font color of the characters are reversed from normal

crusj commented 2 years ago

Fixed It is color scheme matter.