Coder Social home page Coder Social logo

changing wiki file extension about wiki.vim HOT 5 CLOSED

lervag avatar lervag commented on September 4, 2024
changing wiki file extension

from wiki.vim.

Comments (5)

lervag avatar lervag commented on September 4, 2024

Hi! Thanks for raising the issue! The idea is actually that this should already be supported, see :help g:wiki_filetypes and g:wiki_link_extension. The first defines which filetypes will activate the "wiki layer". The second allows to make explicit which file extensions to use for wiki links. You can also make links without extensions, in which case the current file extension is assumed when resolving the link.

However, you are right that there are some hard coded .wiki extensions. I'll fix that asap.

from wiki.vim.

lervag avatar lervag commented on September 4, 2024

I think my latest commit solves the hard coded extensions. Let me know if I should have missed something or if I accidentally broke something.

from wiki.vim.

slonik-az avatar slonik-az commented on September 4, 2024

WoW! That was quick. I will try the changes when I am back in town and will report the results.

from wiki.vim.

slonik-az avatar slonik-az commented on September 4, 2024

Took it for a spin based on the latest commit in master (commit:8f4c7a80) using .wmd extension instead of .wiki. MacVim (vim-8.1.950) on MacOSX-10.12.6 (Sierra).

In my .vim/vimrc:

let g:wiki_filetypes = ['wiki']
let g:wiki_link_extension = '.wmd'
let g:wiki_mappings_use_defaults = 1

I also used wiki-ft.vim plugin where I temporarily replaced .wiki extension with .wmd.

Opening a file gvim index.wmd brings up a new file with filetype set to wiki. Highlighting of headers and links seems to be working. Concealing of brackets around links seems to be working too. But there are problems:

What does not work:

  • wiki-link-open does not work. Pressing <CR> over [[my-wiki-page]] has no effect (moves cursor to the next line, that's it).
  • <leader>ww tries to open /index.wiki instead of /index.wmd.
  • <TAB> has no effect (it is supposed to move cursor to the next wikilink).

from wiki.vim.

lervag avatar lervag commented on September 4, 2024

Sorry about the slow reply! So:

ww tries to open /index.wiki instead of /index.wmd.

Yes, the extension used for WikiIndex is the first entry in g:wiki_filetypes. So, if you use wmd as an extension for files that has the filetype .wiki, then you should use `let g:wiki_filetypes = ['wmd'].

I can understand that this might be somewhat misleading. The g:wiki_link_extension option is only used to set which extension is used when creating links.

I believe that things should work for you if you update the settings as mentioned above.

Note: You do not have to set the g:wiki_mappings_use_defaults when you use the default value.

from wiki.vim.

Related Issues (20)

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.