Skip to content

fftyjw/DeepSeekChat.vim

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

DeepSeekChat for Vim & Neovim

record

Requirements

     pip3 install httpx[http2]

Installation

call plug#begin()
Plug 'fftyjw/DeepSeekChat.vim'
call plug#end()

"ApiKey must set for non-local models.
let g:deepseek_chat_cfg = {
    \ "ApiKey": "<your api key>",
    \ }

Usage

Commands

  • :DeepSeekChatOpen - Open chat window.
  • :DeepSeekChat - Ask a question using the text you input in the chat buffer. If there is any text visually selected, the selected text will be used. Otherwise, it will use all the text from the current line up to the separator line or the tip line (If generated by the plugin itself).
  • :DeepSeekChatNew - Start a new chat session. This will clear the chat history.
  • :DeepSeekChatDebug - Print debug info, include config and chat history.

Mappings

In the chat buffer, these mappings are set by default. You can disable it by set g:deepseek_chat_automap to 0

  • <C-s> - Command DeepSeekChat

  • <C-n> - Command DeepSeekChatNew

  • <C-d> - Command DeepSeekChatDebug

    You can define your own mapings like this:

      let g:deepseek_chat_automap=0
      function! MyDeepSeekChatMap()
          if bufname('%') == 'deepseekchat'
              nnoremap <buffer> <c-s> :<C-u>call deepseekchat#cmd('chat')<CR>
              inoremap <buffer> <c-s> <esc>:call deepseekchat#cmd('chat')<CR>
              vnoremap <buffer> <c-s> <esc>:call deepseekchat#cmd_v('chat')<CR>
              noremap <buffer> <c-n> :<C-u>call deepseekchat#cmd('new')<CR>
              inoremap <buffer> <c-n> <esc>:call deepseekchat#cmd('new')<CR>
              noremap <buffer> <c-d> :<C-u>call deepseekchat#cmd('debug')<CR>
              inoremap <buffer> <c-d> <esc>:call deepseekchat#cmd('debug')<CR>
          endif
      endfunction
      autocmd BufEnter * call MyDeepSeekChatMap()
      noremap <leader>ss :DeepSeekChatOpen<CR>

Config

  • g:deepseek_chat_cfg Basic configs. Example:
    "Online model
    let g:deepseek_chat_cfg = {
        \ "ApiKey": "xxxxxxx", "Put your api key here. This is required for non-local models.
        \ "The chat buffer's filetype is 'markdown'. To render it nicely, the plugin offers 2 types of separator lines:
        \ "  1: A black 2-pixel-high separator line. 
        \ "  2: Normal separator line.(Markdown code: ***). 
        \ "If this config is set to 0, there will be no separator lines.
        \ "HtmlSepType": 0, 
        \ }
        
    "Local model
    let g:deepseek_chat_cfg = {
        \ "AIServerType": "Use 'deepseek' for online models and 'ollama' for local models.
        \ "Model": "xxxxxx", "Put your local model name here. 
        \ "HideThink": 1,
        \ "HtmlSepType": 0, 
        \ }
  • g:deepseek_chat_automap 0: Disable auto mapping. 1: Enable auto mapping. Default 1.

License

Anti 996

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published