Wikia

Vim Tips Wiki

Changes: Function to use Sweyla's Color Theme Generator

Edit

Back to page

(Created page with "Write the first paragraph of your article here. ==Section heading== Sweyla has a color theme generator. Here's a simple function and some mappings to pull down a theme from ...")
 
(Insert TipProposed template + minor manual clean)
 
Line 1: Line 1:
Write the first paragraph of your article here.
+
{{TipProposed
+
|id=0
==Section heading==
+
|previous=0
+
|next=0
Sweyla has a color theme generator. Here's a simple function and some mappings to pull down a theme from Swelya.
+
|created=July 27, 2012
+
|complexity=basic
"" Plugins and Scripts
+
|author=
function! s:UpdateSweyla(...)
+
|version=7.0
if a:0 > 0
+
|subpage=/201207
let l:timestamp = a:1
+
|category1=
else
+
|category2=
let l:timestamp = system("date +%s")
+
}}
endif
+
Sweyla has a [http://themes.sweyla.com/ color theme generator]. Here is a simple function and some mappings to download a theme from Swelya.
let l:timestamp = substitute(l:timestamp, "\n$", "", "g")
+
<pre>
let l:return = system("wget -q -O $HOME/.vim/colors/sweyla.vim http://themes.sweyla.com/vim/sweyla" . l:timestamp . ".vim")
+
function! s:UpdateSweyla(...)
+
if a:0 > 0
colo sweyla
+
let l:timestamp = a:1
endfunction
+
else
command! -nargs=? Sweyla call s:UpdateSweyla(<args>)
+
let l:timestamp = system("date +%s")
nmap <Leader>w :Sweyla<CR>
+
endif
+
let l:timestamp = substitute(l:timestamp, "\n$", "", "g")
==References==
+
let l:return = system("wget -q -O $HOME/.vim/colors/sweyla.vim http://themes.sweyla.com/vim/sweyla" . l:timestamp . ".vim")
* http://themes.sweyla.com/
+
colorscheme sweyla
*{{help|toc}}
+
endfunction
  +
command! -nargs=? Sweyla call s:UpdateSweyla(<args>)
  +
nnoremap <Leader>w :Sweyla<CR>
  +
</pre>
   
 
==Comments==
 
==Comments==
  +
If this is kept (what exactly does it do?), should replace the timestamp stuff with the builtin function (see [[Insert current date or time]]). Clarify that tip contains a path which would need to be modified on some systems. My personal opinion is that simplifying the job of downloading and running a script is not always desirable. Who controls sweyla.com? [[User:JohnBot|JohnBot]] ([[User talk:JohnBot|talk]]) 04:48, July 30, 2012 (UTC)

Latest revision as of 04:48, July 30, 2012

Recently created tip

We have not yet decided whether to keep this tip as its own page or merge it somewhere else. If you have a suggestion on the tip content, please edit this page or add your comments below (do not use the discussion page).

Please discuss whether to keep this as a new tip, or whether to merge it into an existing tip, on the new tips discussion page.
created July 27, 2012 · complexity basic · version 7.0

Sweyla has a color theme generator. Here is a simple function and some mappings to download a theme from Swelya.

function! s:UpdateSweyla(...)
  if a:0 > 0
    let l:timestamp = a:1
  else
    let l:timestamp = system("date +%s")
  endif
  let l:timestamp = substitute(l:timestamp, "\n$", "", "g")
  let l:return = system("wget -q -O $HOME/.vim/colors/sweyla.vim http://themes.sweyla.com/vim/sweyla" . l:timestamp . ".vim")
  colorscheme sweyla
endfunction
command! -nargs=? Sweyla call s:UpdateSweyla(<args>)
nnoremap <Leader>w :Sweyla<CR>

CommentsEdit

If this is kept (what exactly does it do?), should replace the timestamp stuff with the builtin function (see Insert current date or time). Clarify that tip contains a path which would need to be modified on some systems. My personal opinion is that simplifying the job of downloading and running a script is not always desirable. Who controls sweyla.com? JohnBot (talk) 04:48, July 30, 2012 (UTC)

Around Wikia's network

Random Wiki