facelessuser / RegReplace

Simple find and replace sequencer plugin for Sublime Text http://facelessuser.github.io/RegReplace/
207 stars 26 forks source link

Command appear but does nothing... #20

Closed lpanebr closed 10 years ago

lpanebr commented 10 years ago

Hello, great plugin (I think)! I am still striving to get a command to work.

What am I doing wrong?

Here's what I did:

_Added two replacements to reg_replace.sublime-settings :_

{
    "replacements": {
        "mark_references_at_line_start": {
            "find": "^([A-Z]{2,}[A-Z, .-;]*)",
            "replace": "#BEGIN#\\1",
            "greedy": true,
            "case": true
        },
        "change_line_breaks_to_spaces": {
            "find": "\\n",
            "replace": " ",
            "greedy": false,
            "case": false
        },
        // Example replacements

Added three commands to Default.sublime-commands:

[
    { // this command runs
     "caption": "MyProject: Save As",
     "command": "save_project_as"
     },
    { // my replacement does not run
     "caption": "Reg Replace: My RegEx Replacement",
     "command": "reg_replace",
     "args": {"replacements": ["mark_references_at_line_start"]}
    },
    { // project sample replacement does not run
     "caption": "Reg Replace: Remove Trailing Spaces",
     "command": "reg_replace",
     "args": {"replacements": ["remove_trailing_spaces"]}
    }
]
facelessuser commented 10 years ago

This is a plugin I heavily use, so I am certain it works. Let's see if we can get you running.

  1. I don't see the "remove_trailing_spaces" definition posted above. Is it in your settings file?
  2. Is this ST2 or ST3?
  3. Please post an example file you are running this on
lpanebr commented 10 years ago
  1. Yes
  2. ST2
  3. will post in 10 minutes but essentially a bunch of regular text lines but lines starting with all caps letters..
lpanebr commented 10 years ago

There you have it @facelessuser the sample is below:

BANDURA, A. Self-efficacy: the exercise of control. New York: Freeman, 1997.
BANDURA, A. Guide for constructing self-efficacy scales. In: PAJARES, F.; URDAN, T. C. Self-efficacy Beliefs of Adolescents. Grennwich: Information Age, 2006.
BANDURA, A. A evolução da teoria social cognitiva. In: BANDURA, A.; AZZI, R. G.; POLYDORO, S. A. J. (Org.). Teoria social cognitiva: conceitos básicos. Colaboração de Anna Edith Bellico da Costa, Fabián Olaz, Fabio Iglesias e Frank Pajares. Porto Alegre: Artmed, 2008.
BARTFIELD, J. K.; OJEHOMON, N.; HUSKEY, K. W.; DAVIS, R. B.; WEE, C. Preferences and Self-efficacy for Diet Modification Among Primary Care Patients. Obesity, v. 18, n. 2, p. 430-432, 2010. PMid:19730424. http://dx.doi.org/10.1038/oby.2009.284
BEZERRA, I. N.; SICHIERI, R. Características e gastos com alimentação fora do domicílio no Brasil. Rev Saúde Pública, v. 44, n. 2, p. 221-229, 2010. Pmid:20339621.
GARCIA, R. W. D. Práticas e comportamento alimentar no meio urbano: um estudo no centro da cidade de São Paulo. Cad Saúde Pública, v. 13, n. 3, p. 455-467, 1997.
INSTITUTO BRASILEIRO DE GEOGRAFIA E ESTATÍSTICA - IBGE. Pesquisa de orçamentos familiares, 2008-2009. Aquisição Domiciliar Per capta. Rio de Janeiro, 2010. Disponível em: <http://www.ibge.gov.br>. Acesso em: 20 dez. 2011..
KYOUNGOK, J.; HEEYOUNG, S. Effects of the Nutrition Education Program on Self-efficacy, Diet Behavior Pattern and Cardiovascular Risk Factors for the Patients with Cardiovascular Disease. J Korean Acad Nurs., v. 38, n. 1, p. 64-73, 2008. http://dx.doi.org/10.4040/jkan.2008.38.1.64
MONTEIRO, C. A. Da privação ao excesso de comida entrevista a Fabrício Marques. Rev Pesq FAPESP, n. 111, p. 5, 2005. Disponível em: <http://www.revistapesquisa.fapesp.br/?art=6&bd=1&pg=1&lg>. Acesso em: jun. 2011.
MONDINE, L.; MONTEIRO, C. A. Mudanças no padrão de alimentação da população urbana brasileira. Rev Saúde Pública, v. 28, n. 6, p. 433-439, 1994. http://dx.doi.org/10.1590/S0034-89101994000600007
NATALI, C. M.; OLIVEIRA, M. C. F.; ALFENAS, R. C. G.; ARAÚJO, R. M. A.; SANT’ANA, L. F. R.; CECON, P. R.; DRUMMOND, L. R.; NATALI, A. J. Impactos dos estágios de mudança de comportamentos alimentar e de atividade física nos perfis bioquímico e antropométrico de portadores de Diabetes mellitus tipo 2. Nutrire: Rev Soc Bras Alim Nutr., v. 37, n. 3, p. 322-334, 2012.
VIANA, N. L. Análise da Aceitabilidade, Consumo da Alimentação Escolar e Estado Nutricional de Escolares no Município de Viçosa-MG. 2007. Dissertação (Mestrado em Ciência da Nutrição)-Universidade Federal de Viçosa, Viçosa, 2007.
OLIVEIRA, M. C. F.; DUARTE, G. K. O Modelo Transteorético Aplicado ao Consumo de Frutas e Hortaliças em Adolescentes. Rev Nutr., v. 19, n. 1, p. 57-64, 2006. http://dx.doi.org/10.1590/S1415-52732006000100006
PROCHASKA J. O.; DiCLEMENTE C. C.; NORCORSS, J. C. In search of how people change: applications to addictive behaviors. Am Psychol., v. 47, n. 9, p. 1102-1114, 1992. PMid:1329589. http://dx.doi.org/10.1037/0003-066X.47.9.1102
PAIVA, F. R. S.; OLIVEIRA, M. C. F.; GASPARINI, E. T.; SILVA, P. L; VIANA, N. L. ; DUARTE, G. K ; SILVA, K. R.; FIALHO, I; QUINTÃO, D. F.; ZANDONADE, E. Segurança alimentar no ambiente escolar: práticas alimentares de escolares da 1ª série do ensino fundamental. In: SIMPÓSIO DE INICIAÇÃO CIENTÍFICA, 15.; AMOSTRA CIENTÍFICA DA PÓS GRADUAÇÃO, 5.; SIMPÓSIO D E EXTENSÃO UNIVERSITÁRIA, 3., 2006, Viçosa. Anais... Viçosa, 2006.
SANTOS, O; DO CARMO, I.; CAMOLAS, J.; VIEIRA, J. Validade do auto-relato do peso e da altura na avaliação do índice de massa corporal da população adulta portuguesa. Endocrinol, Diabetes Obesid., v. 3, n. 4-6 , p. 157-168 , 2009.
UNIVERSITY OF RHODE ISLAND. Weight Control: Stages of Change (Short Form). Disponível em: <http://www.uri.edu/research/cprc/measures/wght_ctrl_stages_change_shrt.html>. Acesso em: jun. 2011.
TRICHES, R. M.; GIUGLIANI, E. R. J. Obesidade,
práticas alimentares e Conhecimentos de nutrição em
escolares. Rev Saúde Publica, v. 39, n. 4, p. 541-547, 2005.
PMid:16113901. http://dx.doi.org/10.1590/S0034-
89102005000400004
YOSHIDA, E. M. P.; PRIMI, R.; PACE, R. Validade
da escala de estágios de mudança. Estud Psicol., v. 20,
n. 3, p. 7-21, 2003.
TORAL, N.; SLATER, B.; CINTRA, I. P.; FISBERG, M.
Comportamento alimentar de adolescentes em relação
ao consumo de frutas e verduras. Rev Nutr., v. 9, n. 3,
p. 331-340, 2006.
WORLD HEALTH ORGANIZATION - WHO.
Physical status: The use and interpretation of
anthropometry. Geneve: World Health Organization,
1995. Report of a WHO Expert Committee. (WHO
Technical Report Séries, n. 854).
facelessuser commented 10 years ago

Seemed to work in ST3.

#BEGIN#BANDURA, A. Self-efficacy: the exercise of control. New York: Freeman, 1997.
#BEGIN#BANDURA, A. Guide for constructing self-efficacy scales. In: PAJARES, F.; URDAN, T. C. Self-efficacy Beliefs of Adolescents. Grennwich: Information Age, 2006.
#BEGIN#BANDURA, A. A evolução da teoria social cognitiva. In: BANDURA, A.; AZZI, R. G.; POLYDORO, S. A. J. (Org.). Teoria social cognitiva: conceitos básicos. Colaboração de Anna Edith Bellico da Costa, Fabián Olaz, Fabio Iglesias e Frank Pajares. Porto Alegre: Artmed, 2008.
#BEGIN#BARTFIELD, J. K.; OJEHOMON, N.; HUSKEY, K. W.; DAVIS, R. B.; WEE, C. Preferences and Self-efficacy for Diet Modification Among Primary Care Patients. Obesity, v. 18, n. 2, p. 430-432, 2010. PMid:19730424. http://dx.doi.org/10.1038/oby.2009.284
#BEGIN#BEZERRA, I. N.; SICHIERI, R. Características e gastos com alimentação fora do domicílio no Brasil. Rev Saúde Pública, v. 44, n. 2, p. 221-229, 2010. Pmid:20339621.
#BEGIN#GARCIA, R. W. D. Práticas e comportamento alimentar no meio urbano: um estudo no centro da cidade de São Paulo. Cad Saúde Pública, v. 13, n. 3, p. 455-467, 1997.
#BEGIN#INSTITUTO BRASILEIRO DE GEOGRAFIA E ESTATÍSTICA - IBGE. Pesquisa de orçamentos familiares, 2008-2009. Aquisição Domiciliar Per capta. Rio de Janeiro, 2010. Disponível em: <http://www.ibge.gov.br>. Acesso em: 20 dez. 2011..
#BEGIN#KYOUNGOK, J.; HEEYOUNG, S. Effects of the Nutrition Education Program on Self-efficacy, Diet Behavior Pattern and Cardiovascular Risk Factors for the Patients with Cardiovascular Disease. J Korean Acad Nurs., v. 38, n. 1, p. 64-73, 2008. http://dx.doi.org/10.4040/jkan.2008.38.1.64
#BEGIN#MONTEIRO, C. A. Da privação ao excesso de comida entrevista a Fabrício Marques. Rev Pesq FAPESP, n. 111, p. 5, 2005. Disponível em: <http://www.revistapesquisa.fapesp.br/?art=6&bd=1&pg=1&lg>. Acesso em: jun. 2011.
#BEGIN#MONDINE, L.; MONTEIRO, C. A. Mudanças no padrão de alimentação da população urbana brasileira. Rev Saúde Pública, v. 28, n. 6, p. 433-439, 1994. http://dx.doi.org/10.1590/S0034-89101994000600007
#BEGIN#NATALI, C. M.; OLIVEIRA, M. C. F.; ALFENAS, R. C. G.; ARAÚJO, R. M. A.; SANT’ANA, L. F. R.; CECON, P. R.; DRUMMOND, L. R.; NATALI, A. J. Impactos dos estágios de mudança de comportamentos alimentar e de atividade física nos perfis bioquímico e antropométrico de portadores de Diabetes mellitus tipo 2. Nutrire: Rev Soc Bras Alim Nutr., v. 37, n. 3, p. 322-334, 2012.
#BEGIN#VIANA, N. L. Análise da Aceitabilidade, Consumo da Alimentação Escolar e Estado Nutricional de Escolares no Município de Viçosa-MG. 2007. Dissertação (Mestrado em Ciência da Nutrição)-Universidade Federal de Viçosa, Viçosa, 2007.
#BEGIN#OLIVEIRA, M. C. F.; DUARTE, G. K. O Modelo Transteorético Aplicado ao Consumo de Frutas e Hortaliças em Adolescentes. Rev Nutr., v. 19, n. 1, p. 57-64, 2006. http://dx.doi.org/10.1590/S1415-52732006000100006
#BEGIN#PROCHASKA J. O.; DiCLEMENTE C. C.; NORCORSS, J. C. In search of how people change: applications to addictive behaviors. Am Psychol., v. 47, n. 9, p. 1102-1114, 1992. PMid:1329589. http://dx.doi.org/10.1037/0003-066X.47.9.1102
#BEGIN#PAIVA, F. R. S.; OLIVEIRA, M. C. F.; GASPARINI, E. T.; SILVA, P. L; VIANA, N. L. ; DUARTE, G. K ; SILVA, K. R.; FIALHO, I; QUINTÃO, D. F.; ZANDONADE, E. Segurança alimentar no ambiente escolar: práticas alimentares de escolares da 1ª série do ensino fundamental. In: SIMPÓSIO DE INICIAÇÃO CIENTÍFICA, 15.; AMOSTRA CIENTÍFICA DA PÓS GRADUAÇÃO, 5.; SIMPÓSIO D E EXTENSÃO UNIVERSITÁRIA, 3., 2006, Viçosa. Anais... Viçosa, 2006.
#BEGIN#SANTOS, O; DO CARMO, I.; CAMOLAS, J.; VIEIRA, J. Validade do auto-relato do peso e da altura na avaliação do índice de massa corporal da população adulta portuguesa. Endocrinol, Diabetes Obesid., v. 3, n. 4-6 , p. 157-168 , 2009.
#BEGIN#UNIVERSITY OF RHODE ISLAND. Weight Control: Stages of Change (Short Form). Disponível em: <http://www.uri.edu/research/cprc/measures/wght_ctrl_stages_change_shrt.html>. Acesso em: jun. 2011.
#BEGIN#TRICHES, R. M.; GIUGLIANI, E. R. J. Obesidade,
práticas alimentares e Conhecimentos de nutrição em
escolares. Rev Saúde Publica, v. 39, n. 4, p. 541-547, 2005.
#BEGIN#PMid:16113901. http://dx.doi.org/10.1590/S0034-
89102005000400004
#BEGIN#YOSHIDA, E. M. P.; PRIMI, R.; PACE, R. Validade
da escala de estágios de mudança. Estud Psicol., v. 20,
n. 3, p. 7-21, 2003.
#BEGIN#TORAL, N.; SLATER, B.; CINTRA, I. P.; FISBERG, M.
Comportamento alimentar de adolescentes em relação
ao consumo de frutas e verduras. Rev Nutr., v. 9, n. 3,
p. 331-340, 2006.
#BEGIN#WORLD HEALTH ORGANIZATION - WHO.
Physical status: The use and interpretation of
anthropometry. Geneve: World Health Organization,
1995. Report of a WHO Expert Committee. (WHO
Technical Report Séries, n. 854).

Let me try ST2.

lpanebr commented 10 years ago

there's gotta be something in ST2... I will try to upgrade again..

facelessuser commented 10 years ago

ST2 results. Looks good to me:

#BEGIN#BANDURA, A. Self-efficacy: the exercise of control. New York: Freeman, 1997.
#BEGIN#BANDURA, A. Guide for constructing self-efficacy scales. In: PAJARES, F.; URDAN, T. C. Self-efficacy Beliefs of Adolescents. Grennwich: Information Age, 2006.
#BEGIN#BANDURA, A. A evolução da teoria social cognitiva. In: BANDURA, A.; AZZI, R. G.; POLYDORO, S. A. J. (Org.). Teoria social cognitiva: conceitos básicos. Colaboração de Anna Edith Bellico da Costa, Fabián Olaz, Fabio Iglesias e Frank Pajares. Porto Alegre: Artmed, 2008.
#BEGIN#BARTFIELD, J. K.; OJEHOMON, N.; HUSKEY, K. W.; DAVIS, R. B.; WEE, C. Preferences and Self-efficacy for Diet Modification Among Primary Care Patients. Obesity, v. 18, n. 2, p. 430-432, 2010. PMid:19730424. http://dx.doi.org/10.1038/oby.2009.284
#BEGIN#BEZERRA, I. N.; SICHIERI, R. Características e gastos com alimentação fora do domicílio no Brasil. Rev Saúde Pública, v. 44, n. 2, p. 221-229, 2010. Pmid:20339621.
#BEGIN#GARCIA, R. W. D. Práticas e comportamento alimentar no meio urbano: um estudo no centro da cidade de São Paulo. Cad Saúde Pública, v. 13, n. 3, p. 455-467, 1997.
#BEGIN#INSTITUTO BRASILEIRO DE GEOGRAFIA E ESTATÍSTICA - IBGE. Pesquisa de orçamentos familiares, 2008-2009. Aquisição Domiciliar Per capta. Rio de Janeiro, 2010. Disponível em: <http://www.ibge.gov.br>. Acesso em: 20 dez. 2011..
#BEGIN#KYOUNGOK, J.; HEEYOUNG, S. Effects of the Nutrition Education Program on Self-efficacy, Diet Behavior Pattern and Cardiovascular Risk Factors for the Patients with Cardiovascular Disease. J Korean Acad Nurs., v. 38, n. 1, p. 64-73, 2008. http://dx.doi.org/10.4040/jkan.2008.38.1.64
#BEGIN#MONTEIRO, C. A. Da privação ao excesso de comida entrevista a Fabrício Marques. Rev Pesq FAPESP, n. 111, p. 5, 2005. Disponível em: <http://www.revistapesquisa.fapesp.br/?art=6&bd=1&pg=1&lg>. Acesso em: jun. 2011.
#BEGIN#MONDINE, L.; MONTEIRO, C. A. Mudanças no padrão de alimentação da população urbana brasileira. Rev Saúde Pública, v. 28, n. 6, p. 433-439, 1994. http://dx.doi.org/10.1590/S0034-89101994000600007
#BEGIN#NATALI, C. M.; OLIVEIRA, M. C. F.; ALFENAS, R. C. G.; ARAÚJO, R. M. A.; SANT’ANA, L. F. R.; CECON, P. R.; DRUMMOND, L. R.; NATALI, A. J. Impactos dos estágios de mudança de comportamentos alimentar e de atividade física nos perfis bioquímico e antropométrico de portadores de Diabetes mellitus tipo 2. Nutrire: Rev Soc Bras Alim Nutr., v. 37, n. 3, p. 322-334, 2012.
#BEGIN#VIANA, N. L. Análise da Aceitabilidade, Consumo da Alimentação Escolar e Estado Nutricional de Escolares no Município de Viçosa-MG. 2007. Dissertação (Mestrado em Ciência da Nutrição)-Universidade Federal de Viçosa, Viçosa, 2007.
#BEGIN#OLIVEIRA, M. C. F.; DUARTE, G. K. O Modelo Transteorético Aplicado ao Consumo de Frutas e Hortaliças em Adolescentes. Rev Nutr., v. 19, n. 1, p. 57-64, 2006. http://dx.doi.org/10.1590/S1415-52732006000100006
#BEGIN#PROCHASKA J. O.; DiCLEMENTE C. C.; NORCORSS, J. C. In search of how people change: applications to addictive behaviors. Am Psychol., v. 47, n. 9, p. 1102-1114, 1992. PMid:1329589. http://dx.doi.org/10.1037/0003-066X.47.9.1102
#BEGIN#PAIVA, F. R. S.; OLIVEIRA, M. C. F.; GASPARINI, E. T.; SILVA, P. L; VIANA, N. L. ; DUARTE, G. K ; SILVA, K. R.; FIALHO, I; QUINTÃO, D. F.; ZANDONADE, E. Segurança alimentar no ambiente escolar: práticas alimentares de escolares da 1ª série do ensino fundamental. In: SIMPÓSIO DE INICIAÇÃO CIENTÍFICA, 15.; AMOSTRA CIENTÍFICA DA PÓS GRADUAÇÃO, 5.; SIMPÓSIO D E EXTENSÃO UNIVERSITÁRIA, 3., 2006, Viçosa. Anais... Viçosa, 2006.
#BEGIN#SANTOS, O; DO CARMO, I.; CAMOLAS, J.; VIEIRA, J. Validade do auto-relato do peso e da altura na avaliação do índice de massa corporal da população adulta portuguesa. Endocrinol, Diabetes Obesid., v. 3, n. 4-6 , p. 157-168 , 2009.
#BEGIN#UNIVERSITY OF RHODE ISLAND. Weight Control: Stages of Change (Short Form). Disponível em: <http://www.uri.edu/research/cprc/measures/wght_ctrl_stages_change_shrt.html>. Acesso em: jun. 2011.
#BEGIN#TRICHES, R. M.; GIUGLIANI, E. R. J. Obesidade,
práticas alimentares e Conhecimentos de nutrição em
escolares. Rev Saúde Publica, v. 39, n. 4, p. 541-547, 2005.
#BEGIN#PMid:16113901. http://dx.doi.org/10.1590/S0034-
89102005000400004
#BEGIN#YOSHIDA, E. M. P.; PRIMI, R.; PACE, R. Validade
da escala de estágios de mudança. Estud Psicol., v. 20,
n. 3, p. 7-21, 2003.
#BEGIN#TORAL, N.; SLATER, B.; CINTRA, I. P.; FISBERG, M.
Comportamento alimentar de adolescentes em relação
ao consumo de frutas e verduras. Rev Nutr., v. 9, n. 3,
p. 331-340, 2006.
#BEGIN#WORLD HEALTH ORGANIZATION - WHO.
Physical status: The use and interpretation of
anthropometry. Geneve: World Health Organization,
1995. Report of a WHO Expert Committee. (WHO
Technical Report Séries, n. 854).
lpanebr commented 10 years ago

oh man.. I am sorry 1000 thousand times...

I didn't try the number one troubleshoting: restart the thing.

After ST2 restart it works!!!

Thanks!

facelessuser commented 10 years ago

LOL. No worries, like I said, I use it all the time so I am pretty confident it works.

I spend more time explaining how to set up rules than actually fixing stuff on this plugin. It only takes me a couple minutes to show it works :smile:.

lpanebr commented 10 years ago

Great!!! It is working!!! Thanks!

I must tell you that it was not super evident to me how to get it working, even after reading the documentation. Are you interested in receiving pull requests?

facelessuser commented 10 years ago

Yeah, pull requests are great. It's a complicated plugin, so I completely understand why it can be confusing.