Git Product home page Git Product logo

dope's Introduction

dope

Stargazers Issues Contributors

What is dope

Many people are interested in my personal configuration. So I created dope.

What does dope do? dope wants vimers to have their own config with high performance

fast speed and modernity.

Structure

├── init.lua
├── lua
│   ├── core
│   │   ├── cli.lua
│   │   ├── helper.lua
│   │   ├── init.lua
│   │   ├── keymap.lua
│   │   ├── options.lua
│   │   └── pack.lua
│   ├── keymap
│   │   ├── config.lua
│   │   └── init.lua
│   └── modules
│       ├── completion
│       │   ├── config.lua
│       │   └── package.lua
│       ├── editor
│       │   ├── config.lua
│       │   └── package.lua
│       ├── tools
│       │   ├── config.lua
│       │   └── package.lua
│       └── ui
│           ├── config.lua
│           └── package.lua
├── snippets
│   ├── lua.json
│   ├── lua.lua
│   └── package.json
  • core heart of dope it include the api of dope
  • modlues plugin module and config in this folder
  • snippets vscode snippets json file

Usage

  • Click button Use this template It will generate a new repo based on dope on your GitHub

Cli tool

bin/dope is a cli tool for dope config. run ./bin/dope help check more detail

you can use /bin/dope debug ui,editor for debug modues. when you get trouble this is useful for your debug, this command mean disable ui editor modules.Then the plugins in ui,editor modules not load.

How to install plugins

dope use lazy.nvim as package management plugin. register a plugin in package.lua by using dope api require('core.pack').package. more usage check the lazy.nvim doc and you can some examples in package.lua file.

How to create module

create a fold inside modlues folder and package.lua file you must created inside your module. dope will auto read this file at startup.

How to config keymap

In dope there are some apis that make it easy to set keymap. All apis are defined in core/keymap.lua.

keymap.(n/i/c/v/x/t)map -- function to generate keymap by vim.keymap.set
keymap.new_opts -- generate opts into vim.keymap.set
-- function type that work with keymap.new_opts
keymap.silent keymap.noremap keymap.expr keymap.nowait keymap.remap
keymap.cmd -- just return string with <Cmd> and <CR>
keymap.cu -- work like cmd but for visual map

Use these apis to config your keymap in keymap folder. In this folder keymap/init.lua is necessary but if you

have many vim mode remap you can config them in keymap/other-file.lua in dope is config.lua just an

example file. Then config plugins keymap in keymap/init.lua. the example of api usage

-- generate keymap in noremal mode
nmap {
  -- packer
  {'<Leader>pu',cmd('Lazy update'),opts(noremap,silent,'Lazy update')},
   {"<C-h>",'<C-w>h',opts(noremap)},
  
}

also you can pass a table not include sub table to `map` like

```lua
nmap {'key','rhs',opts(noremap,silent)}

use :h vim.keymap.set to know more about.

Tips

  • Improve key repeat
mac os need restart
defaults write NSGlobalDomain KeyRepeat -int 1
defaults write NSGlobalDomain InitialKeyRepeat -int 10

linux
xset r rate 210 40

Donate

If you'd like to support my work financially, buy me a drink through paypal

License MIT

dope's People

Contributors

alexrusselldev avatar coien-rr avatar geekya215 avatar glepnir avatar heliosgo avatar hezhizhen avatar jerry-moo avatar mathisto avatar philopence avatar rakerzh avatar saifulapm avatar umed avatar zootedb0t avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

dope's Issues

issues in setup

HI, whenever i open a file with .db extension this error pops up.
Screenshot_20221020_123316

  1. no highlights in html files.
    Screenshot_20221020_154705

issues in python

Hi, i have 2 issues i face again and again in python.

  1. Whenever i create a set in python then the indent applied is doubled.
  2. When i want to change a long line in python then that line is auto divided in 2 lines.
    IMG20221220070752

The first one is confirmed issue with neovim. and idk about the 2nd but it sometimes make it 2.
Note: Im not talking about wrap. but sometimes the long line becomes 2 lines when i try to change it.

/bin/dope is not working

Runtime Environment

  • Operating system and version: WSL2 Ubuntu20.04
  • Terminal emulator and version: Windows Termmial
  • lua version 5.3.3

Current Behavior

when I first ran ./bin/dope help, it showed

bash: ./dope: /usr/local/bin/lua: bad interpreter: No such file or directory

Then I tried lua /bin/dope help, it produced the following error

lua: ./dope:57: module 'core.helper' not found:
        no field package.preload['core.helper']
        no file '/usr/local/share/lua/5.3/core/helper.lua'
        no file '/usr/local/share/lua/5.3/core/helper/init.lua'
        no file '/usr/local/lib/lua/5.3/core/helper.lua'
        no file '/usr/local/lib/lua/5.3/core/helper/init.lua'
        no file '/usr/share/lua/5.3/core/helper.lua'
        no file '/usr/share/lua/5.3/core/helper/init.lua'
        no file './core/helper.lua'
        no file './core/helper/init.lua'
        no file 'sh: 1: nvim: not found
/lua/vim/core/helper.lua'
        no file 'sh: 1: nvim: not found
/lua/core/helper.lua'
        no file '/usr/local/lib/lua/5.3/core/helper.so'
        no file '/usr/lib/x86_64-linux-gnu/lua/5.3/core/helper.so'
        no file '/usr/lib/lua/5.3/core/helper.so'
        no file '/usr/local/lib/lua/5.3/loadall.so'
        no file './core/helper.so'
        no file '/usr/local/lib/lua/5.3/core.so'
        no file '/usr/lib/x86_64-linux-gnu/lua/5.3/core.so'
        no file '/usr/lib/lua/5.3/core.so'
        no file '/usr/local/lib/lua/5.3/loadall.so'
        no file './core.so'
stack traceback:
        [C]: in function 'require'
        ./dope:57: in main chunk
        [C]: in ?

Did the errror have anything to do my installation of lua? (I just use sudo apt install lua5.3 to install )

fixed

  • use it as configuration file for neovim
  • open neovim and quit
  • then I can use dope

Suggestion on template repository and nightly

Hey! glad to see your re-activity after a period down(as just my speculation). And fernvim is really nice.

I would suggest you to make this repo as a template repository so that ppl can generate theirs with the same structure. See Creating a template repository.

In addition, the nightly config on lua/core/options.lua will cause error on none nightly version (mine is 0.7.2). May you consider add a version detection with vim.inspect(vim.version()) or such thing?

E5113: Error while calling lua chunk: vim/loader.lua:0: attempt to call upvalue '' (a nil value)

Hello,

First thank you for the concise structure for nvim configs.
Second, I need your help with this error I got after installing nvim from source on Ubuntu and cloning your dope in the ~/.config/nvim and running it with ./bin/dope

Error detected while processing /home/user/.config/nvim/init.lua: E5113: Error while calling lua chunk: vim/loader.lua:0: attempt to call upvalue '' (a nil value) local/share/nvim/lazy/lazy.nvim/lua/lazy/init.lua:

Thank you,
Ovi

Support binding multiple keys to the same target in the one configuration item

Example:

imap({
  -- { 'jk', '<ESC>', opts(noremap, 'Goto Normal mode') },
  -- { 'kj', '<ESC>', opts(noremap, 'Goto Normal mode') },
  -- { 'jj', '<ESC>', opts(noremap, 'Goto Normal mode') },
  { { 'jk', 'kj', 'jj' }, '<ESC>', opts(noremap, 'Goto Normal mode') },
  -- ...
})

xmap({
  -- { 'J', ":move '>+1<CR>gv-gv", opts(noremap, 'Move current line/block up in visual mode')) },
  -- { '<A-j>', ":move '>+1<CR>gv-gv", opts(noremap, 'Move current line/block up in visual mode')) },
  -- { 'K', ":move '<-2<CR>gv-gv", opts(noremap, 'Move current line/block down in visual mode')) },
  -- { '<A-k>', ":move '<-2<CR>gv-gv", opts(noremap, 'Move current line/block down in visual mode')) },
  { { 'J', '<A-j>' }, ":move '>+1<CR>gv-gv", opts(noremap, 'Move current line/block up in visual mode')) },
  { { 'K', '<A-k>' }, ":move '<-2<CR>gv-gv", opts(noremap, 'Move current line/block down in visual mode')) },
  -- ...
})

This way will be convenient, If you think it's ok, I'm happy to start a PR for this.

tansparent line at right side

How to get rid of that transparent line at right side of file. The line starts from top to bottom....
Help needed....

Error in completion

Hi, i get this error when enter insert mode.
IMG20221011090650

** INFO **

Cosynvim
nvim v0.8.0
OS: Artix Linux rolling
DE: KDE Plasma 5.25.5
Terminal: Alacritty

能否在 windows 10 下安装?

我在 windows 下安装,启动后显示空白界面,SPC f f 提示 E492: 不是编辑器的命令: Telescope find_files,这其中有什么机关?

具体操作如下:

  1. cd ...\AppData\Local, git clone https://github.com/glepnir/cosynvim nvim
  2. 启动 neovim,自动 clone packer.vim,成功。
  3. 进入 PackerSync 界面,提示成功。
  4. 关闭 neovim,再次启动 neovim,neovim 显示一个空白界面(指的是空的 buffer,而不是欢迎或dashboard界面),why?
  5. SPC f f 提示 E492: 不是编辑器的命令: Telescope find_files(检查 nvim-data 下的 site\pack\packer\start 目录,没有任何文件,似是没有安装任何插件,why?)

lspsaga not found

Hey,

I've got a problem with lspsaga. When I open eg some *.cpp files I get following errors:

Error detected while processing BufReadPost Autocommands for "*":
Error executing lua callback: ...ocal/Cellar/neovim/0.9.1/share/nvim/runtime/filetype.lua:21: Error executing lua: ...ocal/Cellar/neovim/0.9.1/share/nvim/runtime/filetype.lua:22: BufReadPost Autocommands f
or "*"..FileType Autocommands for "*"..function <SNR>1_LoadFTPlugin[19]..script /usr/local/Cellar/neovim/0.9.1/share/nvim/runtime/ftplugin/cpp.vim[13]../usr/local/Cellar/neovim/0.9.1/share/nvim/runtime/ftp
lugin/c.lua: Vim(runtime):E5112: Error while creating lua chunk: cannot open /usr/local/Cellar/neovim/0.9.1/share/nvim/runtime/ftplugin/c.lua: Too many open files
stack traceback:
        [C]: in function 'nvim_cmd'
        ...ocal/Cellar/neovim/0.9.1/share/nvim/runtime/filetype.lua:22: in function <...ocal/Cellar/neovim/0.9.1/share/nvim/runtime/filetype.lua:21>
        [C]: in function 'nvim_buf_call'
        ...ocal/Cellar/neovim/0.9.1/share/nvim/runtime/filetype.lua:21: in function <...ocal/Cellar/neovim/0.9.1/share/nvim/runtime/filetype.lua:10>
stack traceback:
        [C]: in function 'nvim_buf_call'
        
Failed to run `config` for lspsaga.nvim

/Users/umed/.config/nvim/lua/modules/completion/config.lua:41: module 'lspsaga' not found:
^Ino field package.preload['lspsaga']
cache_loader: module lspsaga not found
cache_loader_lib: module lspsaga not found
^Ino file './lspsaga.lua'
^Ino file '/usr/local/share/luajit-2.1.0-beta3/lspsaga.lua'
^Ino file '/usr/local/share/lua/5.1/lspsaga.lua'
^Ino file '/usr/local/share/lua/5.1/lspsaga/init.lua'
^Ino file './lspsaga.so'
^Ino file '/usr/local/lib/lua/5.1/lspsaga.so'
^Ino file '/usr/local/lib/lua/5.1/loadall.so'

# stacktrace:
  - ~/.config/nvim/lua/modules/completion/config.lua:41 _in_ **config**

when I try to open list of packages it shows that lspsaga is installed in $HOME/projects/lspsaga.nvim, but I have nothing there.
I think that path got cached somewhere, but I can't reset this. I tried to clean

  • ~/.local/share/nvim
  • ~/.local/state/nvim
  • ~/.cache/nvim

but nothing helped so far.

Sorry for coming up here with this, but maybe do you have any idea where else I cloud take a look?

Thanks in advance!

lua ./bin/dope help works , but lua ./bin/dope install goes wrong

Runtime Environment
Operating system and version: Ubuntu18.04
Terminal emulator and version: Windows Termmial
lua version 5.4

Current Behavior
when I use : lua ./bin/dope help
everything goes fine

but when I use: lua ./bin/dope install, It produced the following error

lua: /home/ubuntu/.config/nvim/lua/core/cli.lua:54: bad argument #1 to 'for iterator' (table expected, got string)
stack traceback:
[C]: in function 'next'
/home/ubuntu/.config/nvim/lua/core/cli.lua:54: in local 'generate_node'
/home/ubuntu/.config/nvim/lua/core/cli.lua:75: in function 'core.cli.get_all_packages'
/home/ubuntu/.config/nvim/lua/core/cli.lua:94: in function 'core.cli.installer'
/home/ubuntu/.config/nvim/lua/core/cli.lua:121: in function 'core.cli.install'
/home/ubuntu/.config/nvim/lua/core/cli.lua:183: in function </home/ubuntu/.config/nvim/lua/core/cli.lua:182>
./bin/dope:90: in main chunk
[C]: in ?

maybe I need configure something but i have no idea please give me some advise

thank you very much

想问一下为什么从 cosynvim 转变成 dope

我之前clone 了cosynvim 再慢慢学习如何用lua 配置nvim..今天上来发现你更新了整个项目。而且我发现core 的很多内容都改变了。helper.lua 和 options.lua 都有修改。想问一下是之前的配置有很大的不足吗? 同时想问一下我如果现在要配置一下lua nvim是按照depo 还是以前的cosynvim呢

`spellfile` is set to an arbitary value and does not respect the first word-list declaration in `spelllang`

First of all, thanks a lot for that lovely neovim configuration boilerplate!

I have found that there's a typographical error in your spellfile option.

opt.spellfile = cache_dir .. 'spell/en.uft-8.add'

spell/en.uft-8.add should be spell/en.utf-8.add.

Furthermore, if spelllang was set to something different (e.g. bg) upon startup - the default fallback of spellfile will be changed to bg.utf-8.add. Note that it seems like neovim won't update the value of spellfile dynamically, unless it was initially set.

I have also found that using multiple spelllangs will make force neovim to fallback to the one that has been declared first.

For example:
:se spelllang=en,bg will fallback to en.utf-8.add,
:se spelllang=bg,en will fallback to bg.utf-8.add,

I was able to mimic neovim's default spellfile behaviour (while preserving the cache_dir path) by doing so:
opt.spellfile = cache_dir .. opt.spelllang:get()[1] .. '.utf-8.add'

Let me know if that makes sense to you and I will make a PR.

Enhancement

HI, one small request is to make the dashboard feature of making newfile more advanced.

For example....
If i want to create a new file from dashboard and i press enter on it. then before opening the empty file it should ask about the file name. like when selected then a small window popup should appear asking for the file name. In this way we wont be needed to save the file in order for syntax-highlighting and more.
Additionally
It would also be great if it becomes able to create directorys or subdirectorys for the file also. like if in the popup window when it asks for file example/lua.lua is given the it should check the exmaple directory in the current directory and if it does not exists then it can create the directory as well with new file (with specified name)..... THANKS~~~!!!

关于telescope lazyload的一些问题

在开始后会有很多插件没有load,之后我想使用telescope的话,第一次启动会出现很多红色的错误,在这之后就不会有问题请问有办法可以解决这个第一次使用未加载插件的错误嘛。下面这张图应该是cmp插件没有加载,导致使用会报错。有时候也会因为telescope-fzy-native.nvim这个插件没加载而报错

2022-09-14_14-46

2022-09-14_14-47

Question

Hi, How to set Tab key for selection of next item in snippet ? and the suggestions that come is annoying the that if i write function and hit enter then it prints the body of snippet. So how to configure it to not select snippet by default and only when i press tab to choose snippet?
THANKS!!!

`XDG_CONFIG_HOME` and `XDG_DATA_HOME` cannot be recongnize correcly by `core.helper`

Neovim support specify data and config dir by setting env XDG_CONFIG_HOME and XDG_DATA_HOME, but cosynvim seem don't support that. I believe this's cause by core.helper only check for XDG_CONFIG_DIR and XDG_DATA_DIR.
Maybe you can use vim.fn.stdpath('config') and vim.fn.stdpath('data') instead of manully check env variables and find the config dir? This can ensure the consistency of behavior with neovim.

Question: How to enable search count

By default, it appears that neovim will calculate the frequency of search results., e.g:
image

However, while using this template, it appears that the function has been disabled. I attempted to modify opt.shortmess in lua/core/option.lua, but no changes were observed. Through it doesn't bother my daily usage, my curiosity about how to restore this function persists.

autoindent for python

Hi, There is an issue from start with cosynvim .. whenever i create a list in python it auto adds 8 spaces instead of 4 in lists... how to make it 4..?
create a .py file and code lis = [] and then hit enter between square brackets and it will be indented 8 spaces.. thanks

`Telescope app` and `Telescope dotfiles`

Telescope appTelescope dotfiles
这两个是在你自己的配置里写的Telescope自定义扩展,在dope里没有,而且似乎不是很通用,是否考虑在dashboard的配置里移除?或者如果能换个更通用的模板的话就更好了。

lua ./bin/dope install fail

/.config/nvim/lua/core/helper.lua:63: attempt to concatenate a nil value (local 'type')

helper.run_git need to enter 3 parameters.
but cli:boot_strap provide only 2 parameters

helper.run_git('folke/lazy.nvim ' .. self.lazy_dir, 'clone')

Thanks.

E5113: Error while calling lua chunk: vim/_meta.lua:0: E474: Invalid argument

It's show that when I open nvim

处理 /home/[usr]/Dotfiles/nvim/config/nvim/init.lua 时发生错误:
E5113: Error while calling lua chunk: vim/_meta.lua:0: E474: Invalid argument
stack traceback:
        [C]: in function 'nvim_set_option_value'
        vim/_meta.lua: in function '_set'
        vim/_meta.lua: in function 'append'
        /home/[usr]/.config/nvim/lua/core/options.lua:56: in main chunk
        [C]: in function 'require'
        /home/[usr]/.config/nvim/lua/core/init.lua:50: in main chunk
        [C]: in function 'require'
        /home/[usr]/Dotfiles/nvim/config/nvim/init.lua:1: in main chunk
请按 ENTER 或其它命令继续

My machine and soft as follow

  • Linux:Manjaro21
  • NVIM v0.8.1

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.